Good evening, Andreas!

Am Mar 8, 2008 um 20:31 schrieb Andreas Hartmann:

Andreas Hartmann schrieb:
Jürgen Ragaller schrieb:
Hi!

I am using metadata in an xsl Transformation.

No problem to insert metadata as a text value of an element:

<tag>
 <meta:value element="element-name"
      ns="http://somedomain.ch/meta";
      default="default-value"
      uuid="[EMAIL PROTECTED]"
      lang="{$language}"/>
</tag>

What I couldn't figure out: is there a possibility (or trick...) to insert the metadata in an attribute? Having the metadata in an attribute would make the subsequent xsl where the metadata is interpreted much cleaner in my case.
That's not possible yet.

... good to know.

But you can add a subsequent stylesheet to convert the element value into an attribute, e.g.:
 <xsl:template match="tag/text()">
   <xsl:attribute name="...">
     <xsl:value-of select="."/>
   </xsl:attribute>
 </xsl:template>

I just noticed that this is not reliable if adjacent text nodes occur instead of a combined one.

This may be better:

 <xsl:template match="tag">
   <tag attribute="{.}"/>
 </xsl:template>

I'll try that (my current text value based approach feels... not so elegant ;-))

I filed an enhancement bug - the attribute syntax would be quite handy.


Thanks so much!

Jürgen






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to