English 中文(简体)
• 如何将办公室2007/2010年的习惯性质与异常低价竞标区分开来?
原标题:How to clear Office Word 2007/2010 custom properties with XSLT?
<xsl:template match="o:CustomDocumentProperties">
        <xsl:copy>
            <xsl:apply-templates select ="@*|node()" />
        </xsl:copy>
</xsl:template>

In word 2003, I am able to get the word s document 2003 s custom properties with the xsl:template match statement above.

What is the syntax to use if I am working on office Word 2007 or 2010?

最佳回答

保存在<代码>Properties要素下,使用下列名称空间:

http://schemas.openxmlformats.org/officeDocument/2006/extended-properties

An example of a custom property for Telephone Number:

<pkg:part pkg:name="/docProps/custom.xml"
        pkg:contentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"
        pkg:padding="256">
        <pkg:xmlData>
            <Properties
                xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
                xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
                <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="3"
                    name="Telephone number">
                    <vt:lpwstr>555-555-5555</vt:lpwstr>
                </property>
            </Properties>
        </pkg:xmlData>
    </pkg:part>

Assuming that you declare the namespace with the prefix "prop" in your stylesheet like this:

xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"

if you save as a single XML file, you can locate them with the following XPath:

pkg:package/pkg:part/pkg:xmlData/prop:Properties

并且,你可以建立这样的模板:

<xsl:template match="prop:Properties">
        <xsl:copy>
            <xsl:apply-templates select ="@*|node()" />
        </xsl:copy>
</xsl:template>
问题回答

暂无回答




相关问题
When test hanging in an infinite loop

I m tokenising a string with XSLT 1.0 and trying to prevent empty strings from being recognised as tokens. Here s the entire function, based on XSLT Cookbook: <xsl:template name="tokenize"> ...

quick xslt for-each question

Let s say I have an XML document that has this: <keywords> <keyword>test</keyword> <keyword>test2</keyword> <keyword>test3</keyword> <keyword>test4</...

XSLT Transform XML with Namespaces

I m trying to transform some XML into HTML using XSLT. Problem: I can t get it to work. Can someone tell me what I m doing wrong? XML: <ArrayOfBrokerage xmlns:i="http://www.w3.org/2001/...

XSLT output to HTML

In my XSLT file, I have the following: <input type="button" value= <xsl:value-of select="name">> It s an error as it violates XML rule. What I actually want is having a value from an ...

Mangling IDs and References to IDs in XML

I m trying to compose xml elements into each other, and the problem I am having is when there s the same IDs. Basically what I need to do is mangle all the IDs in an xml file, as well as the ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...

热门标签