Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    display xml help.

    I need to create to display a output preview of a xml file of:

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="abc.xsl"?>
    <root>
    <header>Welcome to my help page</header>
    <body>Introduction. Welcome to our webpage.</body>
    <copyright>Copyright 2002</copyright>
    </root>

    Anyone can guide me to use DOM, Javascript to display out all the elements but with some changes to it?
    I would like to create a preview output to my page(not transform, just output that show all the tags as well) with/without a textarea that look like this:

    <?xml version="1.0?>
    <?xml-stylesheet type="text/xsl" href="abc.xsl"?>
    <root>
    <header>Welcome ... </header>
    <body>Introduction ...</body>
    <copyright>Copyright ...</copyright>
    </root>

    that means it don't have to show all the values of the elements, just one word with 3 ".". I can now only output everything with alert(objDOM.xml); but i need to modify abit adding "..." inside.
    I've have no idea how to modify the value of the elements, however i now how to add new elements. Therefore i'm stucked.
    Please help if possible...

    Desperate...

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could give each element a title attribute containing the text you want, for example:

    <header title="Welcome...">Welcome to my help page</header>

    Then just pick out the attributes in your transformation.

    patrick


  •  

    Posting Permissions

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