?
Solved

xml and stylesheet

Posted on 2013-06-19
4
Medium Priority
?
429 Views
Last Modified: 2013-06-23
Hi, I am new to xml and stylesheets, I have the attached xml Invoice file that I am trying to match up with the attached stylesheet.  The stylesheet is using the <xsl:choose> to determine if the Invoice file is a Credit note or an Invoice.  It keeps returning the Credit Note option when in fact it should be an invoice.  Any ideas on how I have gone wrong?
CBS.xsl
JK2006024.xml
0
Comment
Question by:sochionnaitj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39261569
You have the namespaces wrong all through your stylesheet

make the choose like this
            <xsl:when test="/abw:ABWInvoice/abw:Invoice/abw:Header/abw:InvoiceType/@Code='INV'">Invoice</xsl:when>

and add the namespace to the stylesheet element

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version='1.0'  
  xmlns:HB='urn:schemas-basda-org:2001:eBUILD:1.00'
  xmlns:si='urn:schemas-basda-org:2000:salesInvoice:xdr:3.01'
  xmlns:abw="http://services.agresso.com/schema/ABWInvoice/2006/11/20"
  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

but you then need to replace si: with abw: all through the stylesheet

or alternatively replcae the binding for si:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version='1.0'  
  xmlns:HB='urn:schemas-basda-org:2001:eBUILD:1.00'
  xmlns:si="http://services.agresso.com/schema/ABWInvoice/2006/11/20"
  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

and leave the rest as is
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 total points
ID: 39261571
mmh, I would take the second approach
(altered stylesheet attached)
CBS.xsl
0
 

Author Closing Comment

by:sochionnaitj
ID: 39270008
Thanks Gertone for your prompt and excellent answer
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39270418
welcome
0

Featured Post

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question