Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes inclusion of xml:lang Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "inclusion of xml:lang" Watch "inclusion of xml:lang" New topic
Author

inclusion of xml:lang

ashwin vulugundam
Greenhorn

Joined: Jul 22, 2011
Posts: 16
i am having xyz.xml which is validated against xyz.xsd

xyz.xml looks like this

<CATALOGUE>
........
</CATALOGUE>

Now if i want to introduce xml:lang="fr-CA" indicating that xml is in canadian french
Now the xml looks like this
<CATALOGUE xml:lang="fr-CA">
....
</CATALOGUE>

What changes i need to make in the xsd to incorporate this change
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 464
    
    2
>What changes i need to make in the xsd to incorporate this change
I hope this is not a riddle or pure mental exercise. Why don't you go ahead with the xsd unchanged? Have you encountered something wrong during validation?
ashwin vulugundam
Greenhorn

Joined: Jul 22, 2011
Posts: 16
hi ,
thanks for the reply.
well i got the solution for the issue.

Need to add namspaces to the XSD.
just add the following
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />

g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 464
    
    2
No, I don't think so. But there are all sorts of validating parsers out there. If your validating parser really needs that, putting an xs:import would certainly not sufficient to validate the xml document, not at all. But I see somebody vote for your "answer", so somebody (and possibly many more) must think you're right - count me out though. I leave you enjoy tje popular votes then.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inclusion of xml:lang
 
Similar Threads
beginner
creating xml file using JDOM having xml:lang
interpretation of command line parameter
reading xml file
How do I retain the comments?