Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2010, 11:05 AM
Authorized User
 
Join Date: May 2009
Posts: 14
Thanks: 3
Thanked 0 Times in 0 Posts
Default This simle simple xsl is not working...what's wrong with this?

Hi,
This XSLT is not producing the tags which I have in bold. This xslt only generates an output file with the data values from the input file without enclosing tags.

Code:
<?xmlversion="1.0"encoding="utf-8" ?>
<xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:msxsl="urn:schemas-microsoft-com:xslt"xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var"exclude-result-prefixes="msxsl var s0"version="1.0"xmlns:s0=http://www.TEST.org/schema/ePR_CFS/Shipment>

<xsl:outputomit-xml-declaration="yes"method="xml"version="1.0" />
<
xsl:templatematch="/">
<xsl:apply-templatesselect="/s0:cfsBillgShipment" />
</xsl:template>
<
xsl:templatematch="/s0:cfsBillgShipment">
<
xsl:apply-templatesselect="/s0:shipment" />
</xsl:template>
<
xsl:templatematch="/s0:shipment">
<
xsl:apply-templatesselect="/s0:shipHeader" />
</xsl:template>
<xsl:templatematch="/s0:shipHeader">
<
ns0:Insert xmlns:ns0="http://Microsoft.LobServices.OracleDB/2007/03/SCOTT/Table/ARC_EPCFS_SHIPMENT_DATA">
<
ns0:RECORDSET>
<
ns0:ARC_EPCFS_SHIPMENT_DATARECORDINSERT>
<
ns0:INTERFACELINETYPE>
<
xsl:value-ofselect="s0:interfaceLineType/text()" />
</
ns0:INTERFACELINETYPE>
<
ns0:REGION_CODE>
<
xsl:value-ofselect="s0:region/text()" />
</
ns0:REGION_CODE>
<
ns0:ORDER_NUMBER>
<
xsl:value-ofselect="s0:orderNumber/text()" />
</
ns0:ORDER_NUMBER>
<
ns0:TRANSACTIONTYPE>
<
xsl:value-ofselect="s0:transactionType/text()" />
</
ns0:TRANSACTIONTYPE>
<
ns0:FROM_CUSTOMER_CODE>
<
xsl:iftest="s0:fromCustomerCode">
<
xsl:value-ofselect="s0:fromCustomerCode/text()" />
</
xsl:if>
</
ns0:FROM_CUSTOMER_CODE>
<
ns0:TO_CUSTOMER_CODE>
<
xsl:value-ofselect="s0:toCustomerCode/text()" />
</
ns0:TO_CUSTOMER_CODE>
<
ns0:NUMBEROFSALESLINE>
<
xsl:value-ofselect="s0:numberOfSalesLine/text()" />
</
ns0:NUMBEROFSALESLINE>
</
ns0:ARC_EPCFS_SHIPMENT_DATARECORDINSERT>
</
ns0:RECORDSET>
</
ns0:Insert>
</xsl:template>
</xsl:stylesheet>
 
Old September 7th, 2010, 11:17 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Whatever you cut and pasted that from it is now gibberish - all the spaces seems to have been deleted, the colour coding is all over the place, and there are many many extra spaces meaning what might be succinct example XSLT is overly long.

Also, you say that it isn't producing the element in bold? With all that color and formatting I can't tell what is bold and what isn't.

I suspect that the problem is that you are using "/X" which will only match the element X if it is the root element in the document, and you seem to be putting the "/" in front of every single element name. Seeing as an XML document can only have one root element I know that wont work.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
spring2009 (September 7th, 2010)
 
Old September 7th, 2010, 02:15 PM
Authorized User
 
Join Date: May 2009
Posts: 14
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Actually removing the / did it. it was so dumb of me. Thanks again for the quick help.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Xsl to Sort the following simple xml: Takashi321 XSLT 3 August 27th, 2007 11:54 AM
Scripting code not working in XSL bigdog-yahoo XSLT 0 April 5th, 2005 02:05 PM
simple but not working! Adam H-W Classic ASP Basics 1 March 5th, 2004 02:41 PM
mid-function not working (i did something wrong) Haroldd Classic ASP Basics 3 February 11th, 2004 04:58 AM
Simple but not working IF THEN statement nlicata Classic ASP Databases 6 June 6th, 2003 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.