Solved

xml and stylesheet

Posted on 2013-06-19
4
411 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
Comment Utility
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
Comment Utility
mmh, I would take the second approach
(altered stylesheet attached)
CBS.xsl
0
 

Author Closing Comment

by:sochionnaitj
Comment Utility
Thanks Gertone for your prompt and excellent answer
0
 
LVL 60

Expert Comment

by:Geert Bormans
Comment Utility
welcome
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
XSD Data to SQL Tables 2 21
Xpath for list of names of first children nodes 5 47
XSLT Assistance 9 44
XSLT Help 12 19
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…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now