Hi james,
Here attached a sample of the file opened in notepad. Again, it displays 
pretty well on the IE.

Any suggestion are most welcome.

shajy




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Thanks guys.

I just got my first lesson in DTD's ;)

My example was wrong. What I have is actually more like this:
<XMLDOC>
        <Organisation>
                <Identifier>89a6ec896b</Identifier>
                <Name>Good XML Consulting</Name>
                <OrganisationAddress>
                        <Address>
                                <Street>10 XML Lane</Street>
                                <Country>XMLville</Country>
                                <Phone>1-800-XML</Phone>
                        </Address>
                </OrganisationAddress>
        </Organisation>
        <Organisation>
                <Identifier>98e98d8b9e</Identifier>
                <Name>Bad XML Consulting</Name>
                <OrganisationAddress>
                </OrganisationAddress>
        </Organisation>
</XMLDOC>

So this DTD would apply nicely:
<!ELEMENT XMLDOC (Organisation+) >
  <!ELEMENT Organisation (Identifier,Name,OrganisationAddress ) >
  <!ELEMENT Identifier (#PCDATA) >
  <!ELEMENT Name (#PCDATA) >
  <!ELEMENT OrganisationAddress (Address?) >
  <!ELEMENT Address (Street,Country,Phone) >
  <!ELEMENT Street (#PCDATA) >
  <!ELEMENT Country (#PCDATA) >
  <!ELEMENT Phone (#PCDATA) >

The language we are using is an OO language similar to Java.
I have a separate method for creating each element.
If the OrganisationAddress reference on Organisation is null then a
message fragment similar to the "Bad XML Consulting" is produced.

At the moment I'm not using a parser to do my XML creation and
processing, just a large amount of String manipulation. It seems to fit
the OO model well. I have looked at using the SAX parser, but I have a
huge amount of code for creations and processing and I don't have the
time to implement the use of the SAX parser.

I might use the parser (with a DTD like above) to check the validity of
the messages when they come in for processing though.

Anyway... enough from me :)

Thanks again.

- Chris


Reply via email to