Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml:lang and XML Schema

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Hi,
I do have a xml file using the xml:lang attribute:
<Text>
<Para xml:lang="en">this is some text</Para>
</Text>
The DTD for this file contained the following, which validates my XML file correctly:
<!ELEMENT Text (Para+) >
<!ELEMENT Para (#PCDATA) >
<!ATTLIST Para xml:lang (en | de | ko) >
Now I want to change my DTD in a XML Schema:
...
<xsd:complexType name="ParaType" mixed="true">
<xsd:attribute name="xml:lang" default="en">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="en"/>
<xsd:enumeration value="de"/>
<xsd:enumeration value="ko"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
... oops, that was sent too fast... here part 2:
My xsv validator tells me that the Schema file is all right. But I do get an error message if I include the xsd in my xml file:
'unexpected attribute xml:lang in <Para> (the Tag wherein I use the ParaType)
- Is my approach converting xml:lang from DTD to XML Schema wrong?
- Where can I find some resources about how to use xml:lang in conjunction with XML Schema?
- Should I omit the xml:lang in my XML file and rather use a common attribute...
Thanks for a little help...
Bye
Berny
 
YanNaing WTint
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Berny,
follow the link, http://www.xfront.com/xml-schema.html and download the tutorial, unzip it.
Check the slide no. 80 of xml-schemas2.ppt under the .....\xml-schemas\xml-course\xml-schemas directory. I hope it'll give you a little help.
Bye
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Yan Naing,
thanks you very much. Tried it, works great. Excellent!
Have a nice day
Berny
 
YanNaing WTint
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm glad that I could help...
Have a good one
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic