You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Yash Talwar <yt...@ca.ibm.com> on 2005/12/02 18:58:19 UTC

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: ytalwar@ca.ibm.com
Phone #:  905-413-5920



"Olivier Guillet" <ol...@interface-ag.de> 
12/02/2005 09:58 AM

To
<xa...@xml.apache.org>
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












RE: Problem with namespace syntax

Posted by Olivier Guillet <ol...@interface-ag.de>.
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:ytalwar@ca.ibm.com]
Sent: Fri 12/2/2005 6:58 PM
To: Olivier Guillet
Cc: xalan-j-users@xml.apache.org
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: ytalwar@ca.ibm.com
Phone #:  905-413-5920



"Olivier Guillet" <ol...@interface-ag.de> 
12/02/2005 09:58 AM

To
<xa...@xml.apache.org>
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