1

I feel that using <xsl:text disable-output-escaping="yes"> is a bit of a workaround.. my intuition tells me that I'm not doing it right if I have to disable output-escaping.

Desired output: <div itemscope itemtype="http://schema.org/Book"> (note: this validates as acceptable HTML5).

Error message: Description: Attribute name "itemscope" associated with an element type "div" must be followed by the ' = ' character.

Successful workaround:

<xsl:text disable-output-escaping="yes">&lt;div itemscope itemtype="http://schema.org/Book"></xsl:text>
..content..
<xsl:text disable-output-escaping="yes">&lt;/div></xsl:text>

Can I do this another (better) way? Should I declare a namespace or schema in the stylesheet? (using XSLT 2.0)

UPDATE: Nevermind. I just found the answer here How can I manage microdata with xslt?

Community
  • 1
  • 1
Paulb
  • 1,471
  • 2
  • 16
  • 39

0 Answers0