[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

xml and stylesheet

Posted on 2013-06-19
4
Medium Priority
?
431 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

656 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