mixing raw xml display w/ formated display

B

blank101

I am an xml beginner trying to figure out if xml will be a good tool
for a problem.

I want to use the functionality associated with viewing raw xml files
(namely the expanding +'s and -'s), but I also want to not display
elements.

For example, if I had:

<name attr='Person 1'>
<first>Carl</first>
<last>Strange</last>
</name>
<name attr='Person 2'>
<first>Jules</first>
<last>Verne</last>
</name>

I would want it to display as

+ Person 1
+ Person 2

where I could then expand it to:

- Person 1
Carl Strange
+ Person 2

Any recommendations? Is this easy in xml? Or is some other tool
better? Thanks
 
M

Martin Honnen

blank101 wrote:

I want to use the functionality associated with viewing raw xml files
(namely the expanding +'s and -'s)

Raw XML files are text files so if you view them raw then you should
only the markup.
What you describe is what some browsers do (namely IE 5/6 on Win and
Mozilla browsers) which apply some XSLT default stylesheet to XML not
associated otherwise with a stylesheet to create a HTML document
displaying the XML as a tree structure that can be collapsed and
expanded with the help of script.
but I also want to not display
elements.

For example, if I had:

<name attr='Person 1'>
<first>Carl</first>
<last>Strange</last>
</name>
<name attr='Person 2'>
<first>Jules</first>
<last>Verne</last>
</name>

I would want it to display as

+ Person 1
+ Person 2

where I could then expand it to:

- Person 1
Carl Strange
+ Person 2

Any recommendations? Is this easy in xml? Or is some other tool
better?

As said, what you see in the browser is HTML with script generated from
XSLT, that is possible of course to do, you need to write an XSLT
stylesheet that generates HTML with script as necessary.
The default stylesheet is available I think, google for that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top