xsl-list
[Top] [All Lists]

RE: Re: Indendation(in HTML) corresposing to the heirarchy in an XML Doc.

2003-06-24 00:08:30
Hi,

My 'inputs' look like this when i converted to HTML:

      Inputs:

           id;getImage;binField;contractName;packageName;

This is how I want them to look like:

      Inputs
          <icon>id
          <icon>binField
          <icon>anotherContainer
              <icon>contractName
                        <icon>getImage
                <icon>packageName
             .   .
             .   .

The XML is a normal XML which follows this tag heirarchy. Thank you in
advance.

It would have helped if you had shown us your actual XML input, but you can get 
the indentation level e.g. with

  <xsl:attribute name="style">
    <xsl:value-of select="concat('margin-left:', 'count(ancestor::*) * 2, 
'em'"/>
  </xsl:attribute>

or 

  <xsl:for-each select="ancestor::*">&#xA0;</xsl:for-each>

or just generate div elements to reconstruct the hierarchy and use the same 
left margin for all of them, i.e.

  <div>
    <div>
        <img ...>anotherContainer
        <div>
        <img ...>contractName

and so forth.

Cheers,

Jarno - VNV Nation: Chosen


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



<Prev in Thread] Current Thread [Next in Thread>