XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Nadège GriesserSubject: xsl works with xmlspy but not with saxon
Author: Nadège Griesser
Date: 27 Nov 2006 12:08 PM
Hi

I have created a stylesheet under xmlspy to transform the following xml file :
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header>
<header xmlns="xmlapi_1.0">
<requestID>XmlApiClient:26</requestID>
</header>
</SOAP:Header>
<SOAP:Body>
<findResponse xmlns="xmlapi_1.0">
<result>
<netw.NetworkElement>
<location>N/A</location>
</netw.NetworkElement>
</result>
</findResponse>
</SOAP:Body>
</SOAP:Envelope>


When applying the stylesheet with xmlspy, I get the result that I want :
<?xml version="1.0" encoding="UTF-8"?>
<IP_MPLS>
<NE ID="10.1.1.223">
<INFO>
<LOCATION>N/A</LOCATION>
</INFO>
</NE>
</IP_MPLS>


When applying the stylesheet with java (Saxon), I get an "empty" result (and no error message) :
<?xml version="1.0" encoding="utf-8"?>


Here is the stylesheet :

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" exclude-result-prefixes="SOAP" xmlns:q="xmlapi_1.0" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:variable name="uppercase">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
<xsl:variable name="lowercase">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:template match="/">
<xsl:apply-templates select="SOAP:Envelope/SOAP:Body/q:findResponse/q:result"/>
</xsl:template>
<xsl:template match="q:result">
<xsl:element name="IP_MPLS" namespace="">
<xsl:apply-templates select="q:netw.NetworkElement"/>
</xsl:element>
</xsl:template>
<xsl:template match="q:netw.NetworkElement">
<xsl:element name="NE" namespace="">
<xsl:attribute name="ID"><xsl:value-of select="q:name"/></xsl:attribute>
<xsl:element name="INFO" namespace="">
<xsl:apply-templates select="q:location"/>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="q:*">
<xsl:element name="{translate(name(.), $lowercase, $uppercase)}" namespace="">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

Why are the results different?
How can I make it work with Saxon?

Thanks for your help,
Nadège

Posttop
Minollo I.Subject: xsl works with xmlspy but not with saxon
Author: Minollo I.
Date: 27 Nov 2006 12:34 PM
I don't see an empty result using Saxon from inside Stylus Studio; I get:

<?xml version='1.0' ?>
<IP_MPLS>
<NE ID="">
<INFO>
<LOCATION>N/A</LOCATION>
</INFO>
</NE>
</IP_MPLS>

If you are not running Stylus Studio to run/test this stylesheet, you may want to contact customer support for the processors/products you are using.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.