-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working on namespace stuff -- can now handle both when xslt is default namespace and when there's no default namespace (any other default namespace breaks stuff, I think)
- Loading branch information
bwrobinett
committed
Nov 2, 2009
1 parent
02f22ea
commit 68dfe2e
Showing
5 changed files
with
44 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1"?> | ||
<?xml-stylesheet type="text/xsl" href="xxx.xsl"?> | ||
<html xmlns:ding="ding"> | ||
<html xmlns:ding="ding" xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>bent</title> | ||
<link rel="stylesheet" type="xml/sss" href="structure_stylesheet_example_alt2.xml"/> | ||
</head> | ||
<body> | ||
<ding:blah></ding:blah> | ||
<ding:blah/> | ||
<p id="xxxxxxxxx">string 0</p> | ||
<ul id="ding" class="blah" title="hello"> | ||
<li>one</li> | ||
<li>two</li> | ||
<li>three</li> | ||
<li>four</li> | ||
</ul> | ||
<p><span id="dong" class="blah foo">string 2</span></p> | ||
<p><span id="doh" class="blah">string 3</span></p> | ||
<p><span>string 4</span></p> | ||
<div><p>string 5</p></div> | ||
<p> | ||
<span id="dong" class="blah foo">string 2</span> | ||
</p> | ||
<p> | ||
<span id="doh" class="blah">string 3</span> | ||
</p> | ||
<p> | ||
<span>string 4</span> | ||
</p> | ||
<div> | ||
<p>string 5</p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
<html xmlns:ding="ding"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<html xmlns:ding="ding" xmlns="http://www.w3.org/1999/xhtml"> | ||
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<title>bent</title> | ||
<link rel="stylesheet" type="xml/sss" href="structure_stylesheet_example_alt2.xml"> | ||
<link rel="stylesheet" type="xml/sss" href="structure_stylesheet_example_alt2.xml"></link> | ||
</head> | ||
<body> | ||
<h1><span>(xxx)</span></h1> | ||
<p id="xxxxxxxxx">string 0</p> | ||
<div xmlns:s="structure_stylesheet" class="wrapper"> | ||
<h1>before list</h1> | ||
<ol id="ding" class="blah ding hey what" title="THIS IS A TITLE"> | ||
<h2>prepend</h2> | ||
<div class="innerwrap"> | ||
<div class="wrapper"><h1>before list</h1><ol id="ding" class="blah ding hey what" title="THIS IS A TITLE"><h2>prepend</h2><div class="innerwrap"> | ||
<li title="ding" class="hey foo hello"><h1 style="color:lightblue;">one</h1></li> | ||
<li title="ding" class="hey foo hello"><h1 style="color:lightblue;">two</h1></li> | ||
<li title="ding" class="hey foo hello"><h1 style="color:lightblue;">three</h1></li> | ||
<li title="ding" class="hey foo hello"><h1 style="color:lightblue;">four</h1></li> | ||
</div><h2>append</h2></ol><h1>after list</h1></div> | ||
<p> | ||
<span id="dong" class="blah foo">string 2</span> | ||
</p> | ||
<p> | ||
<span id="doh" class="blah">string 3</span> | ||
</p> | ||
<p> | ||
<span>string 4</span> | ||
</p> | ||
<div> | ||
<p>string 5</p> | ||
</div> | ||
<h2>append</h2> | ||
</ol> | ||
<h1>after list</h1> | ||
</div> | ||
<p><span id="dong" class="blah foo">string 2</span></p> | ||
<p><span id="doh" class="blah">string 3</span></p> | ||
<p><span>string 4</span></p> | ||
<div><p>string 5</p></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?xml version="1.0"?> | ||
<axsl:stylesheet xmlns:axsl="http://www.w3.org/1999/XSL/Transform" xmlns:ding="ding" xmlns:s="structure_stylesheet" version="1.0"><axsl:output method="html" encoding="ISO-8859-1"/><axsl:template match="@*|node()"><axsl:copy><axsl:apply-templates select="@*|node()"/></axsl:copy></axsl:template><axsl:template match="ul[@id = 'ding'][contains(concat(normalize-space(@class), ' '), 'blah ')]" priority="11011"><div class="wrapper"><h1>before list</h1><axsl:element name="ol"><axsl:apply-templates select="@*"/><axsl:attribute name="title">THIS IS A TITLE</axsl:attribute><axsl:variable name="orig_classes" select="concat(normalize-space(@class), ' ')"/><axsl:variable name="classes"><axsl:value-of select="$orig_classes"/><axsl:if test="not(contains($orig_classes, 'blah '))">blah </axsl:if><axsl:if test="not(contains($orig_classes, 'ding '))">ding </axsl:if><axsl:if test="not(contains($orig_classes, 'hey '))">hey </axsl:if><axsl:if test="not(contains($orig_classes, 'what '))">what </axsl:if></axsl:variable><axsl:variable name="trimmed_classes" select="normalize-space($classes)"/><axsl:if test="$trimmed_classes"><axsl:attribute name="class"><axsl:value-of select="$trimmed_classes"/></axsl:attribute></axsl:if><h2>prepend</h2><div class="innerwrap"><axsl:apply-templates select="node()" mode="id4483421"/></div><h2>append</h2></axsl:element><h1>after list</h1></div></axsl:template><axsl:template match="node()" mode="id4483421"><axsl:apply-templates select="."/></axsl:template><axsl:template match="li" priority="1" mode="id4483421"><axsl:element name="{name()}"><axsl:apply-templates select="@*"/><axsl:attribute name="title">ding</axsl:attribute><axsl:variable name="orig_classes" select="concat(normalize-space(@class), ' ')"/><axsl:variable name="classes"><axsl:value-of select="$orig_classes"/><axsl:if test="not(contains($orig_classes, 'hey '))">hey </axsl:if><axsl:if test="not(contains($orig_classes, 'foo '))">foo </axsl:if><axsl:if test="not(contains($orig_classes, 'hello '))">hello </axsl:if></axsl:variable><axsl:variable name="trimmed_classes" select="normalize-space($classes)"/><axsl:if test="$trimmed_classes"><axsl:attribute name="class"><axsl:value-of select="$trimmed_classes"/></axsl:attribute></axsl:if><h1 style="color:lightblue;"><axsl:apply-templates select="node()"/></h1></axsl:element></axsl:template><axsl:template match="ding:blah" priority="1"><axsl:element name="h1"><axsl:apply-templates select="@*"/><span>(<axsl:apply-templates select="node()"/>xxx)</span></axsl:element></axsl:template><axsl:template match="processing-instruction('xml-stylesheet')"/></axsl:stylesheet> | ||
<axsl:stylesheet xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:axsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:ding="ding" xmlns:s="structure_stylesheet" version="1.0" exclude-result-prefixes="s xhtml"><axsl:output method="html" encoding="ISO-8859-1"/><axsl:template match="@*|node()"><axsl:copy><axsl:apply-templates select="@*|node()"/></axsl:copy></axsl:template><axsl:template match="xhtml:ul[@id = 'ding'][contains(concat(normalize-space(@class), ' '), 'blah ')]" priority="11011"><div class="wrapper"><h1>before list</h1><axsl:element name="ol"><axsl:apply-templates select="@*"/><axsl:attribute name="title">THIS IS A TITLE</axsl:attribute><axsl:variable name="orig_classes" select="concat(normalize-space(@class), ' ')"/><axsl:variable name="classes"><axsl:value-of select="$orig_classes"/><axsl:if test="not(contains($orig_classes, 'blah '))">blah </axsl:if><axsl:if test="not(contains($orig_classes, 'ding '))">ding </axsl:if><axsl:if test="not(contains($orig_classes, 'hey '))">hey </axsl:if><axsl:if test="not(contains($orig_classes, 'what '))">what </axsl:if></axsl:variable><axsl:variable name="trimmed_classes" select="normalize-space($classes)"/><axsl:if test="$trimmed_classes"><axsl:attribute name="class"><axsl:value-of select="$trimmed_classes"/></axsl:attribute></axsl:if><h2>prepend</h2><div class="innerwrap"><axsl:apply-templates select="node()" mode="id4483438"/></div><h2>append</h2></axsl:element><h1>after list</h1></div></axsl:template><axsl:template match="node()" mode="id4483438"><axsl:apply-templates select="."/></axsl:template><axsl:template match="xhtml:li" priority="1" mode="id4483438"><axsl:element name="{name()}"><axsl:apply-templates select="@*"/><axsl:attribute name="title">ding</axsl:attribute><axsl:variable name="orig_classes" select="concat(normalize-space(@class), ' ')"/><axsl:variable name="classes"><axsl:value-of select="$orig_classes"/><axsl:if test="not(contains($orig_classes, 'hey '))">hey </axsl:if><axsl:if test="not(contains($orig_classes, 'foo '))">foo </axsl:if><axsl:if test="not(contains($orig_classes, 'hello '))">hello </axsl:if></axsl:variable><axsl:variable name="trimmed_classes" select="normalize-space($classes)"/><axsl:if test="$trimmed_classes"><axsl:attribute name="class"><axsl:value-of select="$trimmed_classes"/></axsl:attribute></axsl:if><h1 style="color:lightblue;"><axsl:apply-templates select="node()"/></h1></axsl:element></axsl:template><axsl:template match="ding:blah" priority="1"><axsl:element name="h1"><axsl:apply-templates select="@*"/><span>(<axsl:apply-templates select="node()"/>xxx)</span></axsl:element></axsl:template><axsl:template match="processing-instruction('xml-stylesheet')"/></axsl:stylesheet> |