Simple Problem

Subject: Simple Problem
From: "Mark Swardstrom" <swards@xxxxxxxxxxx>
Date: Thu, 27 Apr 2000 02:03:31 PDT
This may be too simple for this group, but here goes...

I'm trying to make a generic XSL script that will take any XML input (I do not know the element names), such as

<root>
 <node>
   <item>data1</item>
   <item2>data2</item3>
 </node>
 <node2>
   <item>data3</item>
   <item2>data4</item3>
   <item3>
     <subItem>data5</subItem>
   </item3>
 </node2>
</root>

And create an HTML format where any element with data would return the 1) local-name, 2) value, and 3) be followed by HTML (in this case a single line separator). Elements without a value (such as <node> here) would not output the local-name, but would output different HTML (a paragraph break).

Such as...
<p>
item: data1<br/>
item2: data2<br/>
</p>
<p>
item: data3<br/>
item2: data4<br/>
<p>
item3: data5<br/>
</p>
</p>

It could be any number of levels deep, but I can be sure that there are no elements with data AND children.

My problem -- I haven't been able to differentiate between nodes with data, and nodes without.

Thanks in advance for your thoughts.

- Mark

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread
  • Simple Problem
    • Mark Swardstrom - Thu, 27 Apr 2000 02:03:31 PDT <=
      • <Possible follow-ups>
      • Ben Robb - Thu, 27 Apr 2000 11:20:08 +0100
      • Kay Michael - Thu, 27 Apr 2000 15:52:44 +0100
      • Kay Michael - Thu, 27 Apr 2000 15:55:54 +0100
      • Ben Robb - Thu, 27 Apr 2000 16:13:49 +0100