You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Pierre Attar <pa...@tireme.fr> on 2000/07/19 17:57:04 UTC

Using xml:lang

Hi,

It seems that I have a problem with Xalan 1.1 (xerces 1.1.2.) while 
validating documents regarding to its DTD when the DTD is using the 
xml:lang attribute.

Using the XML and Namespace recommendation,
"The namespace prefix, unless it is xml or xmlns, must have been declared 
... The prefix xml is by definition bound to the namespace name 
http://www.w3.org/XML/1998/namespace."
I try :
<!DOCTYPE TEST [
<!ELEMENT TEST (#PCDATA)>
<!ATTLIST TEST
xml:lang NMTOKEN 'fr'
 >
]>
<TEST xml:lang="fr">Some text in french</TEST>

The answer from Xerces is :
[Error] attribute xml:lang not found in element type TEST
Parser error: Attribute "xml:lang" must be declared for element type "TEST".



Even if I add a namespace declaration
<!DOCTYPE TEST [
<!ELEMENT TEST (#PCDATA)>
<!ATTLIST TEST
xml:lang NMTOKEN 'fr'
 >
]>
<TEST xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="fr">Some 
text in french</TEST>
It does not work.

The only thing that does work is well formed validation, with no doctype :
<?xml version="1.0" encoding="utf-8"?>
<TEST xml:lang="fr">Some text in french</TEST>

Someone test this using rxp on the xml-dev list and it works :
"rxp successfully validated your example."


Any idea ? I'm usin the command line base of xalan, with something like :

java org.apache.xalan.xslt.Process -in myfile.xml -xsl mystyle.xsl -out 
myoutput.xml


Regards,
Pierre



Re: Using xml:lang

Posted by Eric Ye <er...@locus.apache.org>.
Yes, that is a bug in namespace binding in XMLDTDScanner, it has been fixed
in the CVS.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Pierre Attar" <pa...@tireme.fr>
To: <xe...@xml.apache.org>
Sent: Wednesday, July 19, 2000 8:57 AM
Subject: Using xml:lang


> Hi,
>
> It seems that I have a problem with Xalan 1.1 (xerces 1.1.2.) while
> validating documents regarding to its DTD when the DTD is using the
> xml:lang attribute.
>
> Using the XML and Namespace recommendation,
> "The namespace prefix, unless it is xml or xmlns, must have been declared
> ... The prefix xml is by definition bound to the namespace name
> http://www.w3.org/XML/1998/namespace."
> I try :
> <!DOCTYPE TEST [
> <!ELEMENT TEST (#PCDATA)>
> <!ATTLIST TEST
> xml:lang NMTOKEN 'fr'
>  >
> ]>
> <TEST xml:lang="fr">Some text in french</TEST>
>
> The answer from Xerces is :
> [Error] attribute xml:lang not found in element type TEST
> Parser error: Attribute "xml:lang" must be declared for element type
"TEST".
>
>
>
> Even if I add a namespace declaration
> <!DOCTYPE TEST [
> <!ELEMENT TEST (#PCDATA)>
> <!ATTLIST TEST
> xml:lang NMTOKEN 'fr'
>  >
> ]>
> <TEST xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="fr">Some
> text in french</TEST>
> It does not work.
>
> The only thing that does work is well formed validation, with no doctype :
> <?xml version="1.0" encoding="utf-8"?>
> <TEST xml:lang="fr">Some text in french</TEST>
>
> Someone test this using rxp on the xml-dev list and it works :
> "rxp successfully validated your example."
>
>
> Any idea ? I'm usin the command line base of xalan, with something like :
>
> java org.apache.xalan.xslt.Process -in myfile.xml -xsl mystyle.xsl -out
> myoutput.xml
>
>
> Regards,
> Pierre
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>