Help with DTD and XML Namespaces
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alan_Fong
Posted On:   Tuesday, November 23, 2004 03:46 PM

Has anyone come across this issue before or can help out, please? I have a DTD (WvSsp.dtd) that contains: … <!ELEMENT PresenceValue (PresenceSubList, Version? )> <!ATTLIST PresenceValue userID CDATA #REQUIRED> <!ELEMENT AttributeList (PresenceSubList)> <!ELEMENT PresenceSubList (#PCDATA)> <!ATTLIST PresenceSubList xmlns CDATA #REQUIRED> … It basically says that any elements declared within PresenceSubList belongs to the defined namespace, so I can potentially have an XML document that has: … T    More>>


Has anyone come across this issue before or can help out, please?


I have a DTD (WvSsp.dtd) that contains:



…


<!ELEMENT PresenceValue (PresenceSubList, Version? )>


<!ATTLIST PresenceValue userID CDATA #REQUIRED>


<!ELEMENT AttributeList (PresenceSubList)>


<!ELEMENT PresenceSubList (#PCDATA)>


<!ATTLIST PresenceSubList xmlns CDATA #REQUIRED>


…


It basically says that any elements declared within PresenceSubList belongs to the defined namespace, so I can potentially have an XML document that has:


…





T


T





…


Where the elements , and are defined in a separate DTD (WvPA.dtd), as such:


…


<!ELEMENT PresenceSubList (OnlineStatus?)>


<!ELEMENT OnlineStatus (Qualifier?, PresenceValue?)>


<!ELEMENT Qualifier (#PCDATA)>


<!ELEMENT PresenceValue (#PCDATA)>


…


Currently, the XML document has header information that defines the main DTD:


<?xml version="1.0" encoding="UTF-8"?>




…


What would the complete XML document look like so that references to both DTD’s are specified, so it can pass a validating parser?


We can’t combine the DTD’s because there are element declarations that use the same name, as shown above with the element.


Any help would be greatly appreciated!


Thanks much,

   <<Less

Re: Help with DTD and XML Namespaces

Posted By:   Anonymous  
Posted On:   Friday, December 17, 2004 03:42 AM

Hi ,

We can do this using XSD

u can speciy schemaLocation attribute in
XML where in u can give
notation like ,



this that if we need to validate against the 2 xsd
we use schemaLocation attribute of XMLSchema with the name,value pair separated by space ,

i hope this will solve u r problem
About | Sitemap | Contact