webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  XML with DTD

    Posted Thu April 14, 2005 10:05 PM

    Hello guys!

    I don’t know if I’m doing mistakes but I can not validate an xml instance on a DTD. I’ve tried to use it in a simple example but it didn’t work as I wanted.

    Here is my DTD:

    <!ELEMENT oasis (album+)>
    <!ELEMENT album (music+)>
    <!ELEMENT music (#PCDATA)>
    <!ATTLIST album name CDATA #REQUIRED>
    <!ATTLIST music track CDATA #REQUIRED>

    And here, my xml:

    <?xml version="1.0"?>
    <!DOCTYPE oasis SYSTEM "oasis.dtd">
    <oasis>
    <album name="The Heathen Chemistry">
    <music track="2">Force of Nature</music>
    <music track="9">She is Love</music>
    </album>
    </oasis>

    The xml is ok, just like was defined at the DTD. But if I put one more tag (i.e. ) after , the browser don’t show me any error message.

    Where am I doing mistake?

    thanks.

    Marcus Vin


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: XML with DTD

    Posted Fri April 15, 2005 11:20 AM

    Hello there,

    You stated :

    the browser don’t show me any error message

    By browser do you mean Internet Explorer or Firefox ? Those softwares provide some “advanced” features do display XML (folding/unfolding). They check well-formness of XML documents BUT they are not validant, they WON’T check that your XML document follows the rules of your DTD/Schema.

    If you want to check that you XML document is valid, use XMLSpy, Oxygen or another tool of your choice.

    Cheers


    #webMethods
    #API-Management
    #Tamino


  • 3.  RE: XML with DTD

    Posted Fri April 15, 2005 09:57 PM

    Now I understand how it works…

    Thanks a lot man!


    #webMethods
    #Tamino
    #API-Management