You are obvisouly using an old version of Xalan-C. I've tried your
stylesheet with versions 1.4 through 1.6, and it works fine.
As a side note, namespace URIs should be absolute, not relative, as the use
of relative URIs in namespaces are officially deprecated by the W3C.
Dave
"Devaprasad
Rajakumar" To:
<[email protected]>
<[EMAIL PROTECTED] cc: (bcc: David N
Bertoni/Cambridge/IBM)
ent.com> Subject: RE: WELCOME to
[email protected]
02/12/2004 09:15
PM
Please respond
to xalan-c-users
Hey, I've tried it with C and J. I will be using Xalan-C. Made a mistake
by posting the J error. It's the same with Xalan-C.
INPUT (ReqDoc.in.xml)
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<rs:data>
<z:row MESSAGE_NUMBER="88888" />
</rs:data>
</xml>
My COMMAND
SAXON -o PIPE_XML.xml ReqDoc.in.xml ENGINE2PIPE_Reqdoc.xsl
My XSL (ENGINE2PIPE_Reqdoc.xsl)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<xsl:output omit-xml-declaration="no" indent="yes"
encoding="ISO-8859-1" version="1.0"/>
<xsl:template match="xml">
<xsl:call-template name="Document_Request_Out"/>
</xsl:template>
<xsl:template name="Document_Request_Out">
<PIPEDocument>
<xsl:attribute
name="ReferenceNumber"><xsl:value-of
select="rs:data/z:row/@MESSAGE_NUMBER"/></xsl:attribute>
</PIPEDocument>
</xsl:template>
</xsl:stylesheet>
My OUTPUT (PIPE_XML.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<PIPEDocument xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"
ReferenceNumber="88888"/>
In XALAN
C:\Xalan>TestXSLT.exe -IN "Reqdoc.in.xml" -XSL ENGINE2PIPE_Reqdoc.xsl
-OUT PIPE_XML.xml
========= Parsing ENGINE2PIPE_Reqdoc.xsl ==========
XSLException Type is: XPathParserException
Message is: Unexpected token!
pattern = 'rs:data/z:row/@MESSAGE_NUMBER'(ENGINE2PIPE_Reqdoc.xsl, 9, 96)
Remaining tokens: ( '#RowsetSchema' ':' 'row' '/' '@' 'MESSAGE_NUMBER')
(ENGINE2PIPE_Reqdoc.xsl, lin
e 9, column 96)
If I remove the # from both files, it works fine.
This is the best I can do.
Thanks,
Dev
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 2:47 AM
To: [email protected]
Subject: RE: WELCOME to [email protected]
Hi,
This works fine with Xalan-C, but it looks like you are using Xalan-J.
Why
are you posting a question about Xalan-J on the Xalan-C users list?
Also, posting snippets of XML documents is not helpful. A small,
_complete_, concise example will make addresssing this much easier.
Dave
"Devaprasad
Rajakumar" To:
<[email protected]>
<[EMAIL PROTECTED] cc: (bcc: David N
Bertoni/Cambridge/IBM)
ent.com> Subject: RE: WELCOME to
[email protected]
02/12/2004 12:43
PM
Please respond
to xalan-c-users
Hi
When using xalan to transform an xml which has one of its namespace
declaration as xmlns:z="#RowsetSchema" using an xsl which has a
corresponding name space declaration as
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
I get the error :
javax.xml.transform.TransformerException: Extra illegal tokens:
'#RowsetSchema', ':', 'row', '/', '@', 'MESSAGE_TYPE', '=', ''UTILTS
E29''
Surprisingly this works fine with saxon and other parsers.
Snippets of my XML and XSL's
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<xml>
<s:Schema id="RowsetSchema">
s:ElementType name="row" content="eltOnly">
<s:AttributeType
name="MESSAGE_TYPE"
rs:number="1" rs:nullable="true" rs:writeunknown="true">
<s:datatype
dt:type="string"
rs:dbtype="str" dt:maxLength="10" rs:fixedlength="true"/>
</s:AttributeType>....
</s:Schema>
<rs:data>
<z:row MESSAGE_TYPE="UTILTS E29" MESSAGE_NUMBER="3000"
MESSAGE_DATE_TIME="2004-02-04T23:09:08"
BALANCE_SUPPLIER_EAN="12" BALANCE_RESPONSIBLE_PARTY_EAN="Grid1"
GRID_AREA_EAN="8716959259711"
METERING_PERIOD_FROM="2002-12-24T13:45:00"
METERING_PERIOD_TO="2002-12-25T13:45:00" ACTIVE_ENERGRY="E"
REASON="RECONCILIATION" SETTLEMENT_METHOD="profiled"
PERIOD_START="2002-12-24T13:45:00" PERIOD_END="2003-01-
24T13:45:00"
VOLUME="101" VOLUME_TYPE="Z01" TIME_FRAME="E10" TIME_RESOLUTION="15"
MEASUREMENT_UNIT="KWH"/>
</z:row>
</xml>
My XSL
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<xsl:output omit-xml-declaration="no" indent="yes" encoding="ISO-8859-1"
version="1.0"/> <xsl:template
match="xml">................</xsl:template></xsl:stylesheet>
If I remove the # from #RowsetSchema everything works fine.
The input XML is generated by MSXML.
What's the workaround for this?
-Dev