• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

DCD validating parser

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Very recently I have started working with XML. I wrote sdat.xml, sdat.dcd and sdat.xsl files. DCD file has been linked in the XML file in DOCTYPE declaraton to validate the XML file. Of course, XSL has also been referred in xml file. I am trying to parse the xml file using xalan parser (of Apache group)as shown below.
c:\xml> java org.apache.xalan.xslt.Process -IN sdat.xml -XSL sdat.xsl -OUT sdat.htm
The output generated is directed to the file called sdat.htm.
The error which I got here is,
XSLT Error (javax.xml.transform.TransformerException): The markup declarations contained or pointed to by the document type declaration must be well-formed.
I am cent percent confidant that my sdat.dcd file is well-formed. Here I am giving the sample code of .dcd and .xml files.
sdat.xml
----------
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by venkat (deque systems) -->
<?xml-stylesheet type="text/xsl" href="sdat.xsl" ?>
<!DOCTYPE SDAT SYSTEM "sdat.dcd">
<SDAT>
<OwnerInformation>
<OwnerName>FRENCH, EDMOND B & B J</OwnerName>
<Use> RESIDENTIAL</Use>
<MailingAddress>
<MAddress>12241 CHERRY HILL RD</MAddress>
<MCity>SILVER SPRING </MCity>
<MState> MD </MState>
<MZip>20904</MZip>
</MailingAddress>
</OwnerInformation>
</SDAT>

sdat.dcd
---------
<?xml version="1.0" encoding="UTF-8"?>
<DCD>
<ElementDef Type="SDAT" Model="Elements" Content="Closed" Root="True">
<Description> It is the root of the document</Description>
<Group RDF:Order="Seq">
<Element>OwnerInformation</Element>
</Group>
</ElementDef>
<ElementDef Type="OwnerInformation" Model="Elements" Content="Closed">
<Group RDF:Order="Seq">
<Element>OwnerName</Element>
<Element>Use</Element>
<Element>MailingAddress</Element>
</Group>
</ElementDef>
<ElementDef Type="OwnerName" Model="Data" Datatype="string"/>
<ElementDef Type="Use" Model="Data" Datatype="string"/>
<ElementDef Type="MailingAddress" Model="Elements"
Content="Closed">
<Group RDF:Order="Seq">
<Element>MAddress</Element>
<Element>MCity</Element>
<Element>MState</Element>
<Element>MZip</Element>
</Group>
</ElementDef>
<ElementDef Type="MAddress" Model="Data" Datatype="string"/>
<ElementDef Type="MCity" Model="Data" Datatype="string"/>
<ElementDef Type="MState" Model="Data" Datatype="string"/>
<ElementDef Type="MZip" Model="Data" Datatype="string"/>
</DCD>

I appreciate if anybody can help me to fix the problem which I have explained above. If the problem lies in the xalan parser, please suggest me a parser that can understand .dcd to parse the xml file. Looking forward for your help...
rgds,
venkat

[This message has been edited by venkat paruchuri (edited August 15, 2001).]
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got this error when I opened just the DCD in IE -

Reference to undeclared namespace prefix: 'RDF'. Line 5, Position 24
<Group RDF:Order="Seq">

The error is self explanatory. You will have to declare the namespace before using it.
 
venkat paruchuri
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, I would like to thank for your response.
<Group> is predefiend node in DCD vocabulary that does not have namespace attribute. Moreover, IE will not understand DCD declarations. Please help me if you have figured out the parser that validates DCD declarations.
rgds,
venkat

[This message has been edited by venkat paruchuri (edited August 16, 2001).]
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't DCD is old( read:ancient! ). I know for sure it has been classified as a "Predecessor" technology. May I ask why are you not using Schema? Checkout XMLSpy. They claim that they support DCDs.
For the benefit of others who may be wondering what DCD is -
Originally spec'ed out by Microsoft and IBM, DCDs provide similar functionality to Document Type Definitions (DTDs), which the XML world initially inherited from SGML, or Standard Generalized Markup Language. But DCDs extend further by supporting other XML-friendly standards such as Resource Description Framework (RDF), XML-Data and XML Namespaces.
HTH

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
venkat paruchuri
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ajit,
DCD has been submitted to W3C in july,1998. Informaton regarding DCD can be found at http://www.w3.org/TR/NOTE-dcd. I am using DCD as it has been my requirement. I have been trying with xmlspy since yesterday. It has a mechanism to create any type of schema file ( such as DTD,DCD, XML-DATA, BizTalk etc). The problem here is, after generating the DCD file by itself, it is giving error while validating the xml file. The error displayed is, 'No content model available for validation'. My doubt is, when the IDE is able to generate DCD, why it is unable to validate it?
I think, this IDE is intelligent in editing any(listed) schema file but it may need a parser to be installed to validate and trasform the xml file. I do not know which parser will support DCD.
thanks,
venkat
 
reply
    Bookmark Topic Watch Topic
  • New Topic