www.webdeveloper.com
Results 1 to 3 of 3

Thread: Is this valid xml ?

  1. #1
    Join Date
    Jun 2009
    Posts
    97

    Is this valid xml ?

    following snippet is taken from workflow pdf manual ts.670.wf.pdf , page 62

    Code:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE workflow SYSTEM "iwwf.dtd">
    <template_script><![CDATA[
    TAG_info(
    description => "<input type='text' value='dark and stormy
    night'>",
    job_name => "<input type='text' value='edit story'>",
    );
    ]]></template_script>
    <workflow name="__TAG__('job_name');"
    owner="__TAG__('iw_areaowner');"
    description="__TAG__('description');">
    in this snippet, root element is 'template_script' but then again there is another 'workflow' element. so how there be an element outside root element ? As per xml syntax rules , all the elements have to be within root elemrnt only.

    Can we have a code or CDATA anywhere in the xml doc ? inside or outside root element ? If I put a code at the beginning of the document as follows is it allowed ?
    Code:
    <template_script><![CDATA[
    TAG_info(
    description => "<input type='text' value='dark and stormy
    night'>",
    job_name => "<input type='text' value='edit story'>",
    );
    ]]></template_script>
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE workflow SYSTEM "iwwf.dtd">
    <workflow name="__TAG__('job_name');"
    owner="__TAG__('iw_areaowner');"
    description="__TAG__('description');">
    Please explain this syntax about elements outside root element.

    thanks

  2. #2
    Join Date
    Jul 2005
    Location
    USA
    Posts
    912
    That is not valid XML if there is no defined root element. A root element must contain all other elements.

  3. #3
    Join Date
    Nov 2002
    Location
    England
    Posts
    693
    It looks like this isn't supposed to be an XML document, rather part of a program that when executed generates an XML document.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles