[opencms-dev] A problem with "Convert XML contents" tool
Georgi Naplatanov
gosho at oles.biz
Mon Feb 18 17:13:03 CET 2013
Hi,
I'm trying to convert old xmlpages to v8textblock with workplace
"Convert XML contents" tool, but after transformation the old file
(xmlpage) contains only
<?xml version="1.0" encoding="UTF-8"?>
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.opencms.org/dtd/6.0/xmlpage.xsd"></pages>
and in the same folder there is not new file.
In the tool's menu I selected :
- Resource type: xmlpage
- VFS folder: - the folder with a xmlpage
- Transformation file (xsl): the path to xsl file (type: plain text)
How is this tool expected to work ?
Outside OpenCms, the xslt file seems to work as expected. The source is
at the end of the mail.
Best regards
Georgi
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<V8Textblocks xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="opencms://system/modules/com.alkacon.opencms.v8.textblock/schemas/textblock.xsd">
<V8Textblock language="en">
<Title><![CDATA[Wonderful World of Flowers]]></Title>
<Paragraph>
<Text name="Text0">
<xsl:apply-templates/>
</Text>
</Paragraph>
</V8Textblock>
</V8Textblocks>
</xsl:template>
<xsl:template match="links">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="link">
<link>
<xsl:copy-of select="./@*"/>
<xsl:copy-of select="./link/@*"/>
<xsl:apply-templates/>
</link>
</xsl:template>
<xsl:template match="target">
<xsl:output cdata-section-elements ="target" />
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="uuid">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="content">
<xsl:output cdata-section-elements ="content" />
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
*Output from OpenCms*
Start Thread transforming XML contents.
Start transforming xml contents.
Parameters:
Resource path: /yyy/
Inclusive sub folders: false
Xslt file: /xmlpage-to-v8block.xslt
Only count files to transform: false
New xsd main file:
opencms://system/modules/com.alkacon.opencms.v8.textblock/schemas/textblock.xsd
Start searching for files to transform...
Number of files found to transform: 1
Transform (published) file (encoding type): /sites/xxx/yyy/a.html (UTF-8)
Publishing files...
Result:
Number of files found to transform: 1
Number of files already transformed: 0
Number of errors while transforming: 0
Number of locked files (could not become transformed): 0
All files could become transformed successful.
Finished transforming xml contents.
Statistics:duration: 00:00:00
End Thread transforming XML contents.
More information about the opencms-dev
mailing list