我会先资格,我不是在XSLT特别好。 但是我想要做的就是3个XML文档复制到一个母文件。
在XSLT工作正常,但正在打印的xmlns =“”这是造成我的验证失败属性的父节点。
所以我的问题是如何从单独的文件复制这些元件,没有它补充说,xmlns属性?
这是输出到目的地的样本 - 注意,我希望它不打印的xmlns =“”。
<Feed xmlns="http://www.bazaarvoice.com/xs/PRR/ProductFeed/5.6"
name="Officeworks" incremental="false"
extractDate="2014-01-28T14:42:12+11:00">
<Brands xmlns="">
<Brand>
<Name>Panasonic</Name>
<ExternalId>12345</ExternalId>
</Brand>
这是XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex">
<xsl:template match="/">
<xsl:variable name="dateNow" select="ex:date-time()"/>
<Feed xmlns="http://www.bazaarvoice.com/xs/PRR/ProductFeed/5.6" name='Officeworks' incremental='false'>
<xsl:attribute name="extractDate"><xsl:value-of select="$dateNow" /></xsl:attribute>
<xsl:copy-of select="document('@dataload.bv.xml.out.tmp@/bv_brands_xml.001.xml')/Brands"/>
<xsl:copy-of select="document('@dataload.bv.xml.out.tmp@/bv_categories_xml.001.xml')/Categories"/>
<xsl:copy-of select="document('@dataload.bv.xml.out.tmp@/bv_products_xml.001.xml')/Products"/>
</Feed>
</xsl:template>
</xsl:stylesheet>