Hi Yash,
Thanks for your answer!
I attached a dummy stylesheet and a sample XML input file.
Using these files with Xalan 2.7.0 brings following error messages:
Line #11; Column 42; XSLT-Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: A node test that matches either NCName:* or QName was expected.
Exception in thread "main" java.lang.RuntimeException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: A node test that matches either NCName:* or QName was expected.
at org.apache.xalan.xslt.Process.doExit(Process.java:1153)
at org.apache.xalan.xslt.Process.main(Process.java:1126)
At line #11 you'll find the template making use of the UML prefix:
<xsl:template match = "UML:Class/@name">
Xalan is started from the command line using:
java org.apache.xalan.xslt.Process -XSL %1 -IN %2 -OUT %3
Best regards
Olivier Guillet
-----Original Message-----
From: Yash Talwar [mailto:[EMAIL PROTECTED]]
Sent: Fri 12/2/2005 6:58 PM
To: Olivier Guillet
Cc: [email protected]
Subject: Re: Problem with namespace syntax
Hi Olivier,
I have tried using the header you provided in my sample and it works for
me.
Can you please attach a complete faling sample?
Thanks!
Yash Talwar
XSLT Development / Xalan
IBM Toronto Lab
EMail: [EMAIL PROTECTED]
Phone #: 905-413-5920
"Olivier Guillet" <[EMAIL PROTECTED]>
12/02/2005 09:58 AM
To
<[email protected]>
cc
Subject
Problem with namespace syntax
Hello,
I am trying to make my stylesheet work with Xalan (I used Saxon until now)
and encountered following problem:
Xalan (2.7.0) does not accept following namespace declaration: xmlns:UML =
"//org.omg/UML/1.3"
I get the error message "A node test that matches either NCName:* or QName
was expected".
I think it's because of the "//" as everything works fine if a remove them
(from the stylesheet and the XML input file).
Here is the complete stylesheet header:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:UML="//org.omg/UML/1.3"
version="1.0" >
I have no influence on the UML namespace as it is generated from a tool
(XMI export function from Borland Together).
Here are my questions:
1) Is the syntax "//" correct for a namespace i.e. should Xalan support
it? Or does Together use a wrong syntax?
2) Is there a workaround I could use?
Thanks for any help!
Regards
Olivier Guillet
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:UML="//org.omg/UML/1.3" version="1.0" > <xsl:output method="xml" indent="yes" encoding="ISO-8859-1" />
<xsl:template match = "UML:Class/@name"> <xsl:value-of select="."/> </xsl:template> </xsl:stylesheet>
<?xml version="1.0" encoding="ISO-8859-1"?>
<XMI xmi.version="1.1" xmlns:UML="//org.omg/UML/1.3">
<XMI.header>
<XMI.documentation>
<XMI.exporter>
TogetherSoft
</XMI.exporter>
<XMI.exporterVersion>
6.0
</XMI.exporterVersion>
</XMI.documentation>
<XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
</XMI.header>
<XMI.content>
<UML:Model xmi.id="00000023">
<UML:Namespace.ownedElement>
<UML:Package xmi.id="00000001_DATCLA" name="DataClasses" isSpecification="false">
<UML:Namespace.ownedElement>
<UML:Class xmi.id="00000002_000001" name="ENTWICKLUNGS_BAUREIHE" isSpecification="false">
<UML:Classifier.feature>
<UML:Attribute xmi.id="00000011_000001" name="ENTWICKLUNGS_BAUREIHE" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000036_IDENT_ALPHANUM_20"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000012_000002" name="LOGISTIK_BAUREIHE" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000041_TEXT_ALPHANUM_20"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000026" name="lnkMONTAGE_WERK_ZUR_BAUREIHE" changeability="changeable" visibility="public" isSpecification="false" ownerScope="instance">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000040_MONTAGE_WERK_ZUR_BAUREI"/>
</UML:StructuralFeature.type>
</UML:Attribute>
</UML:Classifier.feature>
</UML:Class>
<UML:Class xmi.id="00000003_000002" name="MONTAGE_WERK" isSpecification="false">
<UML:Classifier.feature>
<UML:Attribute xmi.id="00000013_000003" name="AOL_RELEVANT" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000038_JANEINCODE_NULLEINS"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000014_000004" name="BENENNUNG" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000042_TEXT_ALPHANUM_50"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000015_000005" name="MONTAGE_ORT" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000036_IDENT_ALPHANUM_20"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000029" name="lnkMONTAGE_WERK_ZUR_BAUREIHE" changeability="changeable" visibility="public" isSpecification="false" ownerScope="instance">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000040_MONTAGE_WERK_ZUR_BAUREI"/>
</UML:StructuralFeature.type>
</UML:Attribute>
</UML:Classifier.feature>
</UML:Class>
<UML:Class xmi.id="00000004_000003" name="MONTAGE_WERK_BEZEICHNUNG" isSpecification="false">
<UML:Classifier.feature>
<UML:Attribute xmi.id="00000016_000006" name="ID" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000037_IDENT_NUM_6_0"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000032" name="lnkMONTAGE_WERK" changeability="changeable" visibility="public" isSpecification="false" ownerScope="instance">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000039_MONTAGE_WERK"/>
</UML:StructuralFeature.type>
</UML:Attribute>
</UML:Classifier.feature>
</UML:Class>
<UML:Class xmi.id="00000005_000004" name="MONTAGE_WERK_ZUR_BAUREIHE" isSpecification="false">
<UML:Classifier.feature>
<UML:Attribute xmi.id="00000017_000007" name="AUSLAUF_TERMIN" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000043_ZEITBEZUG_DATE"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000018_000008" name="EINSATZ_TERMIN" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000043_ZEITBEZUG_DATE"/>
</UML:StructuralFeature.type>
</UML:Attribute>
</UML:Classifier.feature>
</UML:Class>
<UML:Class xmi.id="00000006_000005" name="TECHNOLOGIE" isSpecification="false">
<UML:Classifier.feature>
<UML:Attribute xmi.id="00000019_000009" name="BEZEICHNUNG" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000042_TEXT_ALPHANUM_50"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000020_000010" name="ID" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000037_IDENT_NUM_6_0"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000021_000011" name="INAKTIV" changeability="changeable" visibility="private" isSpecification="false">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000038_JANEINCODE_NULLEINS"/>
</UML:StructuralFeature.type>
</UML:Attribute>
<UML:Attribute xmi.id="00000035" name="lnkMONTAGE_WERK" changeability="changeable" visibility="public" isSpecification="false" ownerScope="instance">
<UML:StructuralFeature.type>
<Foundation.Core.Classifier xmi.idref="00000039_MONTAGE_WERK"/>
</UML:StructuralFeature.type>
</UML:Attribute>
</UML:Classifier.feature>
</UML:Class>
</UML:Namespace.ownedElement>
</UML:Package>
<UML:Association xmi.id="00000007_000001" name="HAT" isSpecification="false">
<UML:Association.connection>
<UML:AssociationEnd xmi.id="00000024" aggregation="composite" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="1" lower="1"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.qualifier>
<UML:Attribute xmi.idref="00000026"/>
</UML:AssociationEnd.qualifier>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000002_000001"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
<UML:AssociationEnd xmi.id="00000025" aggregation="none" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="-1" lower="0"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000005_000004"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
</UML:Association.connection>
</UML:Association>
<UML:Association xmi.id="00000008_000002" name="HAT" isSpecification="false">
<UML:Association.connection>
<UML:AssociationEnd xmi.id="00000027" aggregation="composite" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="1" lower="1"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.qualifier>
<UML:Attribute xmi.idref="00000029"/>
</UML:AssociationEnd.qualifier>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000003_000002"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
<UML:AssociationEnd xmi.id="00000028" aggregation="none" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="-1" lower="1"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000005_000004"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
</UML:Association.connection>
</UML:Association>
<UML:Association xmi.id="00000009_000003" name="HAT" isSpecification="false">
<UML:Association.connection>
<UML:AssociationEnd xmi.id="00000030" aggregation="none" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="1" lower="1"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.qualifier>
<UML:Attribute xmi.idref="00000032"/>
</UML:AssociationEnd.qualifier>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000004_000003"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
<UML:AssociationEnd xmi.id="00000031" aggregation="none" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="1" lower="1"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000003_000002"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
</UML:Association.connection>
</UML:Association>
<UML:Association xmi.id="00000010_000004" name="HAT" isSpecification="false">
<UML:Association.connection>
<UML:AssociationEnd xmi.id="00000033" aggregation="none" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="-1" lower="0"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.qualifier>
<UML:Attribute xmi.idref="00000035"/>
</UML:AssociationEnd.qualifier>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000006_000005"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
<UML:AssociationEnd xmi.id="00000034" aggregation="none" changeability="changeable" isSpecification="false" targetScope="instance">
<UML:AssociationEnd.multiplicity>
<UML:Multiplicity>
<UML:Multiplicity.range>
<UML:MultiplicityRange upper="1" lower="1"/>
</UML:Multiplicity.range>
</UML:Multiplicity>
</UML:AssociationEnd.multiplicity>
<UML:AssociationEnd.type>
<Foundation.Core.Classifier xmi.idref="00000003_000002"/>
</UML:AssociationEnd.type>
</UML:AssociationEnd>
</UML:Association.connection>
</UML:Association>
<UML:Stereotype xmi.id="00000102" name="pk" baseClass="Attribute" visibility="public" icon="" isSpecification="false">
<UML:Stereotype.extendedElement>
<Foundation.Core.ModelElement xmi.idref="00000011_000001"/>
</UML:Stereotype.extendedElement>
</UML:Stereotype>
<UML:Stereotype xmi.id="00000116" name="pk" baseClass="Attribute" visibility="public" icon="" isSpecification="false">
<UML:Stereotype.extendedElement>
<Foundation.Core.ModelElement xmi.idref="00000015_000005"/>
</UML:Stereotype.extendedElement>
</UML:Stereotype>
<UML:Stereotype xmi.id="00000121" name="pk" baseClass="Attribute" visibility="public" icon="" isSpecification="false">
<UML:Stereotype.extendedElement>
<Foundation.Core.ModelElement xmi.idref="00000016_000006"/>
</UML:Stereotype.extendedElement>
</UML:Stereotype>
<UML:Stereotype xmi.id="00000135" name="pk" baseClass="Attribute" visibility="public" icon="" isSpecification="false">
<UML:Stereotype.extendedElement>
<Foundation.Core.ModelElement xmi.idref="00000020_000010"/>
</UML:Stereotype.extendedElement>
</UML:Stereotype>
<UML:DataType xmi.id="00000036_IDENT_ALPHANUM_20" name="IDENT_ALPHANUM_20" visibility="public" isSpecification="false"/>
<UML:DataType xmi.id="00000037_IDENT_NUM_6_0" name="IDENT_NUM_6_0" visibility="public" isSpecification="false"/>
<UML:DataType xmi.id="00000038_JANEINCODE_NULLEINS" name="JANEINCODE_NULLEINS" visibility="public" isSpecification="false"/>
<UML:DataType xmi.id="00000039_MONTAGE_WERK" name="MONTAGE_WERK" visibility="public" isSpecification="false"/>
<UML:DataType xmi.id="00000040_MONTAGE_WERK_ZUR_BAUREI" name="MONTAGE_WERK_ZUR_BAUREIHE" visibility="public" isSpecification="false"/>
<UML:DataType xmi.id="00000041_TEXT_ALPHANUM_20" name="TEXT_ALPHANUM_20" visibility="public" isSpecification="false"/>
<UML:DataType xmi.id="00000042_TEXT_ALPHANUM_50" name="TEXT_ALPHANUM_50" visibility="public" isSpecification="false"/>
<UML:DataType xmi.id="00000043_ZEITBEZUG_DATE" name="ZEITBEZUG_DATE" visibility="public" isSpecification="false"/>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
</XMI>
