Skip to content

Commit

Permalink
Prefer exsl:document over non-standard xsl:document.
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Nov 1, 2013
1 parent 693fd0c commit 7b0da7e
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 27 deletions.
9 changes: 6 additions & 3 deletions src/codegen/basics.xsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template match="list|object|fill-byte|context" mode="ctor"/>
<xsl:template match="flagged|if" mode="ctor">
Expand Down Expand Up @@ -46,7 +49,7 @@
<!-- *************** -->

<xsl:template name="basics">
<xsl:document href="g{/format/@format}Basics.cpp" method="text">
<exsl:document href="g{/format/@format}Basics.cpp" method="text">
//
// g<xsl:value-of select="/format/@format"/>Basics.cpp
//
Expand Down Expand Up @@ -156,7 +159,7 @@ int <xsl:value-of select="@name"/>::id = <xsl:value-of select="@id"/>;
<xsl:with-param name="itemName">opcode</xsl:with-param>
</xsl:call-template>
}
</xsl:document>
</exsl:document>
</xsl:template>


Expand Down
10 changes: 7 additions & 3 deletions src/codegen/dumper.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template name="dumper">
<xsl:document href="g{/format/@format}Dumper.cpp" method="text">
<exsl:document href="g{/format/@format}Dumper.cpp" method="text">
//
// g<xsl:value-of select="/format/@format"/>Dumper.cpp
//
Expand Down Expand Up @@ -34,7 +38,7 @@ void <xsl:value-of select="@name"/>::dump( int indent, Context *ctx ) {

}

</xsl:document>
</exsl:document>
</xsl:template>


Expand Down
12 changes: 8 additions & 4 deletions src/codegen/header.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template name="header">
<xsl:document href="{/format/@format}.h" method="text">
<exsl:document href="{/format/@format}.h" method="text">
//
// g<xsl:value-of select="/format/@format"/>.h
//
Expand Down Expand Up @@ -48,7 +52,7 @@ struct Context {
<xsl:variable name="tmp">
<xsl:element name="{@type}"/>
</xsl:variable>
<xsl:apply-templates select="exslt:node-set($tmp)" mode="ctype"/>
<xsl:apply-templates select="exsl:node-set($tmp)" mode="ctype"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@name"/>;
</xsl:for-each>
Expand Down Expand Up @@ -83,7 +87,7 @@ class <xsl:value-of select="@name"/> : public <xsl:apply-templates select="." mo

}
#endif
</xsl:document>
</exsl:document>
</xsl:template>

<!-- definitions -->
Expand Down
10 changes: 7 additions & 3 deletions src/codegen/parser.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template name="parser">
<xsl:document href="g{/format/@format}Parser.cpp" method="text">
<exsl:document href="g{/format/@format}Parser.cpp" method="text">
//
// g<xsl:value-of select="/format/@format"/>Parser.cpp
//
Expand Down Expand Up @@ -47,7 +51,7 @@ bool <xsl:value-of select="@name"/>::parse( Reader *r, int end, Context *ctx ) {

}

</xsl:document>
</exsl:document>
</xsl:template>


Expand Down
10 changes: 7 additions & 3 deletions src/codegen/parsexml.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template name="parsexml">
<xsl:document href="g{/format/@format}ParseXML.cpp" method="text">
<exsl:document href="g{/format/@format}ParseXML.cpp" method="text">
//
// g<xsl:value-of select="/format/@format"/>ParseXML.cpp
//
Expand Down Expand Up @@ -116,7 +120,7 @@ void <xsl:value-of select="@name"/>::parseXML( xmlNodePtr node, Context *ctx ) {

}

</xsl:document>
</exsl:document>
</xsl:template>


Expand Down
10 changes: 7 additions & 3 deletions src/codegen/size.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template name="size">
<xsl:document href="g{/format/@format}Size.cpp" method="text">
<exsl:document href="g{/format/@format}Size.cpp" method="text">
//
// g<xsl:value-of select="/format/@format"/>Size.cpp
//
Expand Down Expand Up @@ -53,7 +57,7 @@ size_t <xsl:value-of select="@name"/>::calcSize( Context *ctx, int start_at ) {

}

</xsl:document>
</exsl:document>
</xsl:template>

<xsl:template match="*[@context]" mode="size-context">
Expand Down
10 changes: 7 additions & 3 deletions src/codegen/writer.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template name="writer">
<xsl:document href="g{/format/@format}Writer.cpp" method="text">
<exsl:document href="g{/format/@format}Writer.cpp" method="text">
//
// g<xsl:value-of select="/format/@format"/>Writer.cpp
//
Expand Down Expand Up @@ -67,7 +71,7 @@ void <xsl:value-of select="@name"/>::write( Writer *w, Context *ctx ) {

}

</xsl:document>
</exsl:document>
</xsl:template>


Expand Down
10 changes: 7 additions & 3 deletions src/codegen/writexml.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">

<xsl:template name="writexml">
<xsl:document href="g{/format/@format}WriteXML.cpp" method="text">
<exsl:document href="g{/format/@format}WriteXML.cpp" method="text">
//
// g<xsl:value-of select="/format/@format"/>WriteXML.cpp
//
Expand Down Expand Up @@ -100,7 +104,7 @@ void <xsl:value-of select="@name"/>::writeXML( xmlNodePtr xml, Context *ctx ) {

}

</xsl:document>
</exsl:document>
</xsl:template>


Expand Down
5 changes: 3 additions & 2 deletions src/xslt/simple-tools.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:swft="http://subsignal.org/swfml/swft"
xmlns:str="http://exslt.org/strings"
xmlns:math="http://exslt.org/math"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="swft"
version='1.0'>

Expand Down Expand Up @@ -202,7 +203,7 @@

<!-- HTML wrapper -->
<xsl:template match="html-wrapper">
<xsl:document href="{@name}">
<exsl:document href="{@name}">
<html>
<body>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
Expand All @@ -217,7 +218,7 @@
</object>
</body>
</html>
</xsl:document>
</exsl:document>
</xsl:template>

<!-- html text (entity-escape xml, for fitting xml/html content in an attribute) -->
Expand Down

0 comments on commit 7b0da7e

Please sign in to comment.