@@ -853,71 +853,70 @@ private function jsonToDomDocumentItem($el, $parent, $doc)
853853
854854 public static function saveJsonXsltStandard () {
855855 return <<<'EOC'
856- <?xml version="1.0"?>
857- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
858- <xsl:output method="text"/>
859- <xsl:variable name='q'>"</xsl:variable>
860- <!-- -->
861- <xsl:template match="/">{
862- <xsl:apply-templates select="*"/>}
863- </xsl:template>
864- <!-- -->
865- <!-- Object or Element Property-->
866- <xsl:template match="*">
867- <xsl:value-of select='concat($q, name(), $q, ": ")' /><xsl:call-template name="Properties"/>
868- </xsl:template>
869- <!-- -->
870- <!-- Array Element -->
871- <xsl:template match="*" mode="ArrayElement">
872- <xsl:call-template name="Properties"/>
873- </xsl:template>
874- <!-- -->
875- <!-- Object Properties -->
876- <xsl:template name="Properties">
877- <xsl:variable name="childName" select="name(*[1])"/>
878- <xsl:choose>
879- <xsl:when test="not(*|@*)"><xsl:value-of select='concat($q, ., $q)' /></xsl:when>
880- <xsl:when test="count(*[name()=$childName]) > 1"><xsl:value-of select='concat("{ ", $q, $childName, $q, ": ")' /> [<xsl:apply-templates select="*" mode="ArrayElement"/>] }</xsl:when>
881- <xsl:otherwise>{
882- <xsl:apply-templates select="@*"/>
883- <xsl:apply-templates select="*"/>
884- }</xsl:otherwise>
885- </xsl:choose>
886- <xsl:if test="following-sibling::*">,</xsl:if>
887- </xsl:template>
888- <!-- -->
889- <!-- Attribute Property -->
890- <xsl:template match="@*">
891- <xsl:value-of select='concat($q, "@", name(), $q, ": ", $q, ., $q)' />
892- <xsl:if test="following-sibling::*">,</xsl:if>
893- </xsl:template>
894- </xsl:stylesheet>
895-
896- EOC;
856+ <?xml version="1.0"?>
857+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
858+ <xsl:output method="text"/>
859+ <xsl:variable name='q'>"</xsl:variable>
860+
861+ <xsl:template match="/">{
862+ <xsl:apply-templates select="*"/>}
863+ </xsl:template>
864+
865+ <!-- Object or Element Property-->
866+ <xsl:template match="*">
867+ <xsl:value-of select='concat($q, name(), $q, ": ")' /><xsl:call-template name="Properties"/>
868+ </xsl:template>
869+
870+ <!-- Array Element -->
871+ <xsl:template match="*" mode="ArrayElement">
872+ <xsl:call-template name="Properties"/>
873+ </xsl:template>
874+
875+ <!-- Object Properties -->
876+ <xsl:template name="Properties">
877+ <xsl:variable name="childName" select="name(*[1])"/>
878+ <xsl:choose>
879+ <xsl:when test="not(*|@*)"><xsl:value-of select='concat($q, ., $q)' /></xsl:when>
880+ <xsl:when test="count(*[name()=$childName]) > 1"><xsl:value-of select='concat("{ ", $q, $childName, $q, ": ")' /> [<xsl:apply-templates select="*" mode="ArrayElement"/>] }</xsl:when>
881+ <xsl:otherwise>{
882+ <xsl:apply-templates select="@*"/>
883+ <xsl:apply-templates select="*"/>
884+ }</xsl:otherwise>
885+ </xsl:choose>
886+ <xsl:if test="following-sibling::*">,</xsl:if>
887+ </xsl:template>
888+
889+ <!-- Attribute Property -->
890+ <xsl:template match="@*">
891+ <xsl:value-of select='concat($q, "@", name(), $q, ": ", $q, ., $q)' />
892+ <xsl:if test="following-sibling::*">,</xsl:if>
893+ </xsl:template>
894+ </xsl:stylesheet>
895+ EOC;
897896 }
898897
899898 public static function saveJsonXsltRecordset () {
900899 return <<<'EOC'
901- <?xml version="1.0"?>
902- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
903- <xsl:output method="text"/>
904- <xsl:variable name='q'>"</xsl:variable>
905- <!-- -->
906- <xsl:template match="/recordset">
907- <xsl:value-of select='concat("{", $q, @zname, $q, ": [")' />
908- <xsl:for-each select='/*/row'>
909- {
910- <xsl:for-each select='field'>
911- <xsl:value-of select='concat($q, @id, $q)' />: <xsl:value-of select='concat($q, ., $q)' />
912- <xsl:if test="following-sibling::*">,</xsl:if>
913- </xsl:for-each>
914- }
915- <xsl:if test="following-sibling::*">,</xsl:if>
916- </xsl:for-each>
917- ]}
918- </xsl:template>
919- </xsl:stylesheet>
920- EOC;
900+ <?xml version="1.0"?>
901+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
902+ <xsl:output method="text"/>
903+ <xsl:variable name='q'>"</xsl:variable>
904+
905+ <xsl:template match="/recordset">
906+ <xsl:value-of select='concat("{", $q, @zname, $q, ": [")' />
907+ <xsl:for-each select='/*/row'>
908+ {
909+ <xsl:for-each select='field'>
910+ <xsl:value-of select='concat($q, @id, $q)' />: <xsl:value-of select='concat($q, ., $q)' />
911+ <xsl:if test="following-sibling::*">,</xsl:if>
912+ </xsl:for-each>
913+ }
914+ <xsl:if test="following-sibling::*">,</xsl:if>
915+ </xsl:for-each>
916+ ]}
917+ </xsl:template>
918+ </xsl:stylesheet>
919+ EOC;
921920 }
922921
923922 public static function saveJsonStylesheet ($ mode ) {
0 commit comments