Jump to content

dare

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dare's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, got it myself - the error was using <xsl:value-of select="text()"/> instead of <xsl:copy-of select="text()"/>
  2. Thanks for the answer and sorry for posting to the wrong forum! When I do a $domart = $procart->transformToDoc($docart); echo htmlentities($domart->saveXML()); all I get is <articleMetadata> <articleNumber>Art. 1</articleNumber> <articleHeader><text> </text></articleHeader> </articleMetadata> This indeed gives me "text :" in the transformed DOM
  3. Hi everyone as I don't think I'll ever figure this out on my own (even with all the doc I read), please tell me what I do wrong, even if it is strictly speaking a xslt-problem. But as XMLSpy evaluates my XPath how I want it to, but not the built-in XSLT-processor in 5.2.6-2ubuntu4.1...: I've got a html-fragment like this: <h5><b>Art. 1</b> Persoenlicher Geltungsbereich</h5> As result of the transformation I'd like to have something as: <articleMetadata> <articleNumber>Art. 1</articleNumber> <articleHeader><text> Persoenlicher Geltungsbereich </text></articleHeader> I try to achieve this by using: <xsl:template match="h5"> <articleMetadata> <xsl:apply-templates select="b"/> <articleHeader><text> <xsl:value-of select="text()"/> </text></articleHeader> </articleMetadata> </xsl:template> <!-- Artikelnummer --> <xsl:template match="b"> <articleNumber> <xsl:value-of select="."/> </articleNumber> </xsl:template> Unfortunately, text() only gives me an empty string. If I try out the full XPath in XMLSpy, text() points me to "Persoenlicher Geltungsbereich". What don't I understand? Thanks for your help! Daniel
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.