babysimon: (Default)
[personal profile] babysimon
For some reason XSL just won't stick in my brain, so I have to ask my friends list.

If I have a document which contains AAA nodes and I want to transform them to BBB nodes I can do something like:
	<xsl:template match="AAA">
		<BBB><xsl:apply-templates/></BBB>
	</xsl:template>


But suppose I want to replace every AAA immediately followed by a CCC (throwing the CCC away)? Something like
	<xsl:template match="AAA/following-sibling::CCC[1]">
		<BBB><xsl:apply-templates/></BBB>
	</xsl:template>

is my guess, but then I'm told "Only child:: and attribute:: axes are allowed in match patterns!"

Anyone got any clues? I'm trying to pretend this isn't just directed at [livejournal.com profile] lozette...
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

April 2017

S M T W T F S
      1
2345678
910 1112131415
16171819202122
23242526272829
30      

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 20th, 2026 07:40 pm
Powered by Dreamwidth Studios