i am new to unmbraco and i need to differentiate between the between the new and the old schema,also i need to know what is the difference and if there is a tool or a way to know the version of the schema
If you need to differentiate between the two schemas from within an XSLT file, you can do this:
<!-- Grab the root node -->
<xsl:variable name="root" select="$currentPage/ancestor::root" />
<!-- Determine if using legacy or v4.5 XML Schema -->
<xsl:variable name="isLegacyXML" select="boolean(not(/$root/*[@isDoc][1]))" />
<xsl:variable name="isNewXML" select="not($isLegacyXML)" />
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$isLegacyXML">
<!-- Do stuff with old XML schema -->
</xsl:when>
<xsl:otherwise>
<!-- Do stuff with new XML schema -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
old and new schema of Xslt in umbraco
i am new to unmbraco and i need to differentiate between the between the new and the old schema,also i need to know what is the difference and if there is a tool or a way to know the version of the schema
Hi Mohamed
To check whether you are using the new or the old XML schema you can take a look in the /config/umbracoSettings.config-file. FInd this line:
If it is set to "false" you are using the new schema otherwise you are using the legacy schema.
I think you might want to check out the following wiki entry to read a bit about the new schema: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
/Kim A
Hi Mohamed,
If you need to differentiate between the two schemas from within an XSLT file, you can do this:
Also, someone wrote an article about supporting both versions in the same file :-)
/Chriztian
is working on a reply...