...

display xml help.

flyclassic
10-02-2002, 07:26 AM
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...

mpjbrennan
10-02-2002, 01:27 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum