The stylesheet GN3ChangeTitle.xsl is used by the import script. It converts elements exported from GN3 (by export script) to GN4 format.
It basically allows to convert the GN3 typography associated to one title (variable GN3Title) to GN4's 'default' typography. In addition, it adds "generic" permissions to the GN3 folders (baskets), by giving full access to the Administrators group and read access to Everyone. It will be then necessary to apply the correct permissions individually to folders in GN4.
This version also corrects the XML generated by GN3Extract.exe which inserts a <photo> element as child of the article's text, rather than a <photoCaption>.
<?xml version="1.0"?> <!-- ################################## Stylesheet to convert elements from GN3 to GN4. It basically allows to convert the GN3 justification scope associated to one title (variable GN3Title) to GN4's 'default' justification scope.
In addition, it adds "generic" permissions to the GN3 folders (baskets), by giving full access to the Administrators group and read access to Everyone. It will be then necessary to apply the correct permissions individually to folders in GN4.
This version also corrects the XML generated by GN3Extract.exe which inserts a <photo> element as child of the article's text, rather than a <photoCaption>
USAGE: srv4 import -in <file.xml> -opt GN3ChangeTitle.xsl
Copyright (C) Miles 33 Ltd. - 2011 ################################### -->
<XmlImportOptions xmlns="http://www.teradp.com/schemas/GN4/1/XmlImportOptions.xsd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gn4="urn:schemas-teradp-com:gn4tera" Validate="false" Overwrite="true" NewVersion="false" CopyAlways="false" SpikeChildren="false"> <Xslt>
<xsl:stylesheet version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<!-- !!!!IMPORTANT CONFIGURATION!!!! This GN3 Title will become the justification scope 'Default' --> <xsl:variable name="GN3Title">XXXXXXX</xsl:variable> <xsl:variable name="GN4namedLogin">false</xsl:variable>
<!-- usare questa query in GN3 per riempire il vettore (attenzione al titleid), attenzione GN3-To-GN4 estra in automatico questa tabella. select '<cat key="+CONVERT(varchar,id,0)+" code="+name+"/>' from ContextTable where titleid=2 order by id --> <xsl:variable name="GN3ToNameFragment" xmlns=""> <!--.....--> </xsl:variable> <xsl:variable name="GN3ToName" select="msxsl:node-set($GN3ToNameFragment)"/>
<!-- usare questa query in GN4 per riempire il vettore select '<cat key="+o.s_name+" code="+CONVERT(varchar,o.s_id,0)+"/>' from s_ObjectTable as o inner join s_JustcontextTable as j on j.s_id=o.s_id order by o.s_id --> <xsl:variable name="GN4FromNameFragment" xmlns=""> <!--...--> </xsl:variable> <xsl:variable name="GN4FromName" select="msxsl:node-set($GN4FromNameFragment)"/>
<!-- Remove Tool form master e pagelayer --> <!-- Change ContextId GN3(id)->GN4(id) --> <xsl:template match="Tool"> <xsl:if test="local-name(../../../..)='libObj'"> <xsl:copy> <xsl:copy-of select="@*[local-name()!='ContextId']"/> <xsl:if test="string(@ContextId)"> <xsl:variable name="cid" select="@ContextId"/> <xsl:variable name="GN3name" select="$GN3ToName/cat[@key=$cid]/@code"/> <xsl:variable name="cidgn4" select="$GN4FromName/cat[@key=$GN3name]/@code"/> <xsl:if test="string($cidgn4)!=''"> <xsl:attribute name="ContextId"> <xsl:value-of select="$cidgn4"/> </xsl:attribute> </xsl:if> </xsl:if> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:if> </xsl:template>
<!-- This is matched only in justScope --> <xsl:template match="justScope"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:choose> <xsl:when test="@name=$GN3Title"> <xsl:attribute name="name">Default</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="name"> <xsl:value-of select="@name"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- justScope -->
<!-- This is matched only in user force namedLogin see $GN4namedLogin--> <xsl:template match="user"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:attribute name="namedLogin"> <xsl:value-of select="$GN4namedLogin"/> </xsl:attribute> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- user -->
<!-- Main matching rule, as we have to change the keyVal(s) whose text is the title but only those that are children of a justification, which is exported in different ways from GN3! --> <xsl:template match="keyVal[string(@xsi:nil)!='true']"> <xsl:copy> <xsl:choose> <xsl:when test="string(text())=$GN3Title"> <xsl:choose> <xsl:when test="../@objectType='justScope' or name(..)='scopeRef' or name(..)='justScope' or name(..)='justScopeRef'">Default</xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:copy> </xsl:template> <!-- keyVal -->
<!-- Folder rule: copies the folder node, adding relevant default permissions to it --> <xsl:template match="folder"> <xsl:copy> <xsl:copy-of select="@*"/> <!-- attributes --> <!-- <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute> --> <access> <securityAccess objectType="group"> <keyVal>Administrators</keyVal> <grant>all</grant> </securityAccess> <securityAccess objectType="group"> <keyVal>Everyone</keyVal> <!-- All users have RefReadNormal so that they can read published objects that are in the /system/users/Administrator folder Explicitely deny ReadNormal to get rid of the ReadNormal coming from RefReadNormal in /system/users --> <deny>ReadNormal</deny> <grant>RefReadNormal</grant> </securityAccess> </access> <xsl:apply-templates/> </xsl:copy> </xsl:template>
<!-- Helpers: webHead and webBody in UK installations don't have any uppercase character. We should actually change the schema to reflect that, but this is oh so easy! <xsl:template match="webhead"> <webHead> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </webHead> </xsl:template> --> <!-- webHead -->
<!--<xsl:template match="webbody"> <webBody> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </webBody> </xsl:template> webbody -->
<!-- Schema GN3 -> GN4 in Article--> <!-- <xsl:template match="testo"> <gn4:body> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:body> </xsl:template> <xsl:template match="foto-dida"> <gn4:photoCaption> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:photoCaption> </xsl:template> <xsl:template match="titolo"> <gn4:head> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:head> </xsl:template>-->
<!-- justContext --> <xsl:template match="typeRef"> <xsl:copy> <xsl:choose> <!-- <xsl:when test="string(text())='testo'">body</xsl:when> <xsl:when test="string(text())='foto-dida'">photoCaption</xsl:when> <xsl:when test="string(text())='titolo'">head</xsl:when>--> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:copy> </xsl:template> <!-- pageLayer/Master --> <xsl:template match="LayerContent/e"> <xsl:copy> <xsl:copy-of select="@*"/> <!-- <xsl:choose> <xsl:when test="@Type='testo'"> <xsl:attribute name="Type">body</xsl:attribute> </xsl:when> <xsl:when test="@Type='foto-dida'"> <xsl:attribute name="Type">photoCaption</xsl:attribute> </xsl:when> <xsl:when test="@Type='titolo'"> <xsl:attribute name="Type">head</xsl:attribute> </xsl:when> </xsl:choose>--> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- txtGeometry --> <xsl:template match="txtRef"> <xsl:copy> <xsl:copy-of select="@*"/> <!-- <xsl:choose> <xsl:when test="@objectType='testo'"> <xsl:attribute name="objectType">body</xsl:attribute> </xsl:when> <xsl:when test="@objectType='foto-dida'"> <xsl:attribute name="objectType">photoCaption</xsl:attribute> </xsl:when> <xsl:when test="@objectType='titolo'"> <xsl:attribute name="objectType">head</xsl:attribute> </xsl:when> </xsl:choose>--> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template>
<!-- All other nodes are copied without change --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> </Xslt> <Pars/> <DefaultObjects/> </XmlImportOptions> |
<?xml version="1.0"?> <!-- ################################## Stylesheet to convert elements from GN3 to GN4. It basically allows to convert the GN3 justification scope associated to one title (variable GN3Title) to GN4's 'default' justification scope.
In addition, it adds "generic" permissions to the GN3 folders (baskets), by giving full access to the Administrators group and read access to Everyone. It will be then necessary to apply the correct permissions individually to folders in GN4.
This version also corrects the XML generated by GN3Extract.exe which inserts a <photo> element as child of the article's text, rather than a <photoCaption>
USAGE: srv4 import -in <file.xml> -opt GN3ChangeTitle.xsl
Copyright (C) Miles 33 Ltd. - 2011 ################################### -->
<XmlImportOptions xmlns="http://www.teradp.com/schemas/GN4/1/XmlImportOptions.xsd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gn4="urn:schemas-teradp-com:gn4tera" Validate="false" Overwrite="true" NewVersion="false" CopyAlways="false" SpikeChildren="false"> <Xslt>
<xsl:stylesheet version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<!-- !!!!IMPORTANT CONFIGURATION!!!! This GN3 Title will become the justification scope 'Default' --> <xsl:variable name="GN3Title">XXXXXXX</xsl:variable> <xsl:variable name="GN4namedLogin">false</xsl:variable> <!-- usare questa query in GN3 per riempire il vettore (attenzione al titleid) select '<cat key="+CONVERT(varchar,id,0)+" code="+name+"/>' from ContextTable where titleid=2 order by id --> <xsl:variable name="GN3ToNameFragment" xmlns=""> <cat key='1' code='J'/> <cat key='1243' code='Y_Date'/> <cat key='1244' code='Y_Dida'/> <cat key='1245' code='Y_Inciso'/> <cat key='1246' code='Y_Testatina'/> <cat key='1248' code='Y_Testo'/> <cat key='1262' code='Y_Tabella'/> <!--.....--> <cat key='1926' code='zTE04_020_boxino personaggio pri'/> <cat key='1927' code='zTE03_020_titolo box personaggio'/> <cat key='1928' code='TSS08_012web'/> <cat key='1929' code='TSS12_022W'/> </xsl:variable> <xsl:variable name="GN3ToName" select="msxsl:node-set($GN3ToNameFragment)"/>
<!-- usare questa query in GN4 per riempire il vettore select '<cat key="+o.s_name+" code="+CONVERT(varchar,o.s_id,0)+"/>' from s_ObjectTable as o inner join s_JustcontextTable as j on j.s_id=o.s_id order by o.s_id --> <xsl:variable name="GN4FromNameFragment" xmlns=""> <cat key='J' code='1671'/> <cat key='Head' code='1672'/> <cat key='WebHead' code='1673'/> <!--...--> <cat key='zTE08_020_cronaca A/b' code='4039'/> <cat key='zTE05_010_cronaca A/b' code='4040'/> <cat key='zTE04_020_boxino personaggio pri' code='4041'/> <cat key='zTE03_020_titolo box personaggio' code='4042'/> <cat key='TSS08_012web' code='4043'/> </xsl:variable> <xsl:variable name="GN4FromName" select="msxsl:node-set($GN4FromNameFragment)"/>
<!-- Remove Tool form master e pagelayer --> <!-- Change ContextId GN3(id)->GN4(id) --> <xsl:template match="Tool"> <xsl:if test="local-name(../../../..)='libObj'"> <xsl:copy> <xsl:copy-of select="@*[local-name()!='ContextId']"/> <xsl:if test="string(@ContextId)"> <xsl:variable name="cid" select="@ContextId"/> <xsl:variable name="GN3name" select="$GN3ToName/cat[@key=$cid]/@code"/> <xsl:variable name="cidgn4" select="$GN4FromName/cat[@key=$GN3name]/@code"/> <xsl:if test="string($cidgn4)!=''"> <xsl:attribute name="ContextId"> <xsl:value-of select="$cidgn4"/> </xsl:attribute> </xsl:if> </xsl:if> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:if> </xsl:template>
<!-- This is matched only in justScope --> <xsl:template match="justScope"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:choose> <xsl:when test="@name=$GN3Title"> <xsl:attribute name="name">Default</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="name"> <xsl:value-of select="@name"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- justScope -->
<!-- This is matched only in user force namedLogin see $GN4namedLogin--> <xsl:template match="user"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:attribute name="namedLogin"> <xsl:value-of select="$GN4namedLogin"/> </xsl:attribute> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- user -->
<!-- Main matching rule, as we have to change the keyVal(s) whose text is the title but only those that are children of a justification, which is exported in different ways from GN3! --> <xsl:template match="keyVal[string(@xsi:nil)!='true']"> <xsl:copy> <xsl:choose> <xsl:when test="string(text())=$GN3Title"> <xsl:choose> <xsl:when test="../@objectType='justScope' or name(..)='scopeRef' or name(..)='justScope' or name(..)='justScopeRef'">Default</xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:copy> </xsl:template> <!-- keyVal -->
<!-- Folder rule: copies the folder node, adding relevant default permissions to it --> <xsl:template match="folder"> <xsl:copy> <xsl:copy-of select="@*"/> <!-- attributes --> <!-- <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute> --> <access> <securityAccess objectType="group"> <keyVal>Administrators</keyVal> <grant>all</grant> </securityAccess> <securityAccess objectType="group"> <keyVal>Everyone</keyVal> <!-- All users have RefReadNormal so that they can read published objects that are in the /system/users/Administrator folder Explicitely deny ReadNormal to get rid of the ReadNormal coming from RefReadNormal in /system/users --> <deny>ReadNormal</deny> <grant>RefReadNormal</grant> </securityAccess> </access> <xsl:apply-templates/> </xsl:copy> </xsl:template>
<!-- Helpers: webHead and webBody in UK installations don't have any uppercase character. We should actually change the schema to reflect that, but this is oh so easy! <xsl:template match="webhead"> <webHead> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </webHead> </xsl:template> --> <!-- webHead -->
<!--<xsl:template match="webbody"> <webBody> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </webBody> </xsl:template> webbody -->
<!-- Schema GN3 -> GN4 in Article--> <xsl:template match="testo"> <gn4:body> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:body> </xsl:template> <xsl:template match="foto-dida"> <gn4:photoCaption> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:photoCaption> </xsl:template> <xsl:template match="titolo"> <gn4:head> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:head> </xsl:template>
<!-- justContext --> <xsl:template match="typeRef"> <xsl:copy> <xsl:choose> <xsl:when test="string(text())='testo'">body</xsl:when> <xsl:when test="string(text())='foto-dida'">photoCaption</xsl:when> <xsl:when test="string(text())='titolo'">head</xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:copy> </xsl:template> <!-- pageLayer/Master --> <xsl:template match="LayerContent/e"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:choose> <xsl:when test="@Type='testo'"> <xsl:attribute name="Type">body</xsl:attribute> </xsl:when> <xsl:when test="@Type='foto-dida'"> <xsl:attribute name="Type">photoCaption</xsl:attribute> </xsl:when> <xsl:when test="@Type='titolo'"> <xsl:attribute name="Type">head</xsl:attribute> </xsl:when> </xsl:choose> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- txtGeometry --> <xsl:template match="txtRef"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:choose> <xsl:when test="@objectType='testo'"> <xsl:attribute name="objectType">body</xsl:attribute> </xsl:when> <xsl:when test="@objectType='foto-dida'"> <xsl:attribute name="objectType">photoCaption</xsl:attribute> </xsl:when> <xsl:when test="@objectType='titolo'"> <xsl:attribute name="objectType">head</xsl:attribute> </xsl:when> </xsl:choose> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template>
<!-- All other nodes are copied without change --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> </Xslt> <Pars/> <DefaultObjects/> </XmlImportOptions> |
<?xml version="1.0"?> <!-- ################################## Stylesheet to convert elements from GN3 to GN4. It basically allows to convert the GN3 justification scope associated to one title (variable GN3Title) to GN4's 'default' typography.
In addition, it adds "generic" permissions to the GN3 folders (baskets), by giving full access to the Administrators group and read access to Everyone. It will be then necessary to apply the correct permissions individually to folders in GN4.
This version also corrects the XML generated by GN3Extract.exe which inserts a <photo> element as child of the article's text, rather than a <photoCaption>
USAGE: srv4 import -in <file.xml> -opt GN3ChangeTitle.xsl
Copyright (C) Miles 33 Ltd. - 2011 ################################### -->
<XmlImportOptions xmlns="http://www.teradp.com/schemas/GN4/1/XmlImportOptions.xsd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gn4="urn:schemas-teradp-com:gn4tera"
Validate="false" Overwrite="true" NewVersion="false" CopyAlways="false" SpikeChildren="false"> <Xslt>
<xsl:stylesheet version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- !!!!IMPORTANT CONFIGURATION!!!! This GN3 Title will become the typography 'Default' --> <xsl:variable name="GN3Title">Globalice</xsl:variable> <xsl:variable name="GN4namedLogin">false</xsl:variable>
<!-- This is matched only in justScope --> <xsl:template match="justScope"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:choose> <xsl:when test="@name=$GN3Title"> <xsl:attribute name="name">Default</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="name"> <xsl:value-of select="@name"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- justScope -->
<!-- This is matched only in user force namedLogin see $GN4namedLogin--> <xsl:template match="user"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:attribute name="namedLogin"> <xsl:value-of select="$GN4namedLogin"/> </xsl:attribute> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- user -->
<!-- Main matching rule, as we have to change the keyVal(s) whose text is the title but only those that are children of a justification, which is exported in different ways from GN3! --> <xsl:template match="keyVal[@xsi:nil!='true']"> <xsl:copy> <xsl:choose> <xsl:when test="string(text())=$GN3Title"> <xsl:choose> <xsl:when test="../@objectType='justScope' or name(..)='scopeRef' or name(..)='justScope' or name(..)='justScopeRef'">Default</xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:copy> </xsl:template> <!-- keyVal -->
<!-- Folder rule: copies the folder node, adding relevant default permissions to it --> <xsl:template match="folder"> <xsl:copy> <xsl:copy-of select="@*"/> <!-- attributes --> <!-- <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute> --> <access> <securityAccess objectType="group"> <keyVal>Administrators</keyVal> <grant>all</grant> </securityAccess> <securityAccess objectType="group"> <keyVal>Everyone</keyVal> <!-- All users have RefReadNormal so that they can read published objects that are in the /system/users/Administrator folder Explicitely deny ReadNormal to get rid of the ReadNormal coming from RefReadNormal in /system/users --> <deny>ReadNormal</deny> <grant>RefReadNormal</grant> </securityAccess> </access> <xsl:apply-templates/> </xsl:copy> </xsl:template>
<!-- Helpers: webHead and webBody in UK installations don't have any uppercase character. We should actually change the schema to reflect that, but this is oh so easy! <xsl:template match="webhead"> <webHead> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </webHead> </xsl:template> --> <!-- webHead -->
<!--<xsl:template match="webbody"> <webBody> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </webBody> </xsl:template> webbody -->
<!-- Schema GN3 -> GN4 in Article--> <xsl:template match="testo"> <gn4:body> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:body> </xsl:template> <xsl:template match="catenaccio"> <gn4:subhead> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:subhead> </xsl:template> <xsl:template match="foto"> <gn4:photoCaption> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:photoCaption> </xsl:template> <xsl:template match="titolo"> <gn4:head> <xsl:copy-of select="@*"/> <xsl:apply-templates select="./*"/> </gn4:head> </xsl:template>
<!-- justContext --> <xsl:template match="typeRef"> <xsl:copy> <xsl:choose> <xsl:when test="string(text())='testo'">body</xsl:when> <xsl:when test="string(text())='catenaccio'">subhead</xsl:when> <xsl:when test="string(text())='foto'">photoCaption</xsl:when> <xsl:when test="string(text())='titolo'">head</xsl:when> <xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise> </xsl:choose> </xsl:copy> </xsl:template> <!-- pageLayer/Master --> <xsl:template match="LayerContent/e"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:choose> <xsl:when test="@Type='testo'"> <xsl:attribute name="Type">body</xsl:attribute> </xsl:when> <xsl:when test="@Type='catenaccio'"> <xsl:attribute name="Type">subhead</xsl:attribute> </xsl:when> <xsl:when test="@Type='foto'"> <xsl:attribute name="Type">photoCaption</xsl:attribute> </xsl:when> <xsl:when test="@Type='titolo'"> <xsl:attribute name="Type">head</xsl:attribute> </xsl:when> </xsl:choose> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template> <!-- txtGeometry --> <xsl:template match="txtRef"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:choose> <xsl:when test="@objectType='testo'"> <xsl:attribute name="objectType">body</xsl:attribute> </xsl:when> <xsl:when test="@objectType='catenaccio'"> <xsl:attribute name="objectType">subhead</xsl:attribute> </xsl:when> <xsl:when test="@objectType='foto'"> <xsl:attribute name="objectType">photoCaption</xsl:attribute> </xsl:when> <xsl:when test="@objectType='titolo'"> <xsl:attribute name="objectType">head</xsl:attribute> </xsl:when> </xsl:choose> <xsl:apply-templates select="./*"/> </xsl:copy> </xsl:template>
<!-- All other nodes are copied without change --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> </Xslt> <Pars/> <DefaultObjects/> </XmlImportOptions> |