Solved

xml and stylesheet

Posted on 2013-06-19
4
419 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
  • 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 500 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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