java 在哪里可以找到 Transformer.setOutputProperty 的属性列表?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2540231/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 21:41:01  来源:igfitidea点击:

Where can I find a list of the properties of Transformer.setOutputProperty?

javaxml

提问by Tom Brito

I would like to know where I can find the list of properties settable by the method Transformer.setOutputProperty(String name, String value).

我想知道在哪里可以找到该方法可设置的属性列表Transformer.setOutputProperty(String name, String value)

采纳答案by skaffman

Rather obscurely, they're documented in the Xalan proprietary javadoc:

相当晦涩的是,它们记录在Xalan 专有的 javadoc 中

This method is used to set or override the value of the effective xsl:output attribute values specified in the stylesheet.

The recognized standard output properties are:

* cdata-section-elements
* doctype-system
* doctype-public
* indent
* media-type
* method
* omit-xml-declaration
* standalone
* version 

For example:

tran.setOutputProperty("standalone", "yes");

此方法用于设置或覆盖样式表中指定的有效 xsl:output 属性值的值。

公认的标准输出属性是:

* cdata-section-elements
* doctype-system
* doctype-public
* indent
* media-type
* method
* omit-xml-declaration
* standalone
* version 

例如:

tran.setOutputProperty("standalone", "yes");

回答by Michael

Also, check out the javax.xml.transform.OutputKeysclass.

另外,看看javax.xml.transform.OutputKeys班级。

tran.setOutputProperty(OutputKeys.STANDALONE, "yes");

回答by BZ.

Essentially, the properties can be anything you put into it. Properties are "defaulted" by default properties specified by section 16 of the XSL Transformations (XSLT) W3C Recommendation. If any of the argument keys are not recognized and are not name-space qualified, the property will be ignored and not returned. If you really need a complete list - I'd say Sec 16 of the W3C recommendations is a good place to start.

本质上,属性可以是您放入其中的任何内容。根据 XSL 转换 (XSLT) W3C 推荐标准的第 16 节指定的默认属性,属性是“默认的” 。如果任何参数键未被识别并且没有命名空间限定,则该属性将被忽略并且不返回。如果你真的需要一个完整的列表 - 我会说 W3C 建议的第 16 节是一个很好的起点。

回答by muxmuse

You can find the documentation of javax.xml.transform.OutputKeysin the Oracle docs:

您可以javax.xml.transform.OutputKeys在 Oracle 文档中找到 的文档:

For Java 10: https://docs.oracle.com/javase/10/docs/api/javax/xml/transform/OutputKeys.html

对于 Java 10:https: //docs.oracle.com/javase/10/docs/api/javax/xml/transform/OutputKeys.html

CDATA_SECTION_ELEMENTS
DOCTYPE_PUBLIC
DOCTYPE_SYSTEM
ENCODING
INDENT
MEDIA_TYPE
METHOD
OMIT_XML_DECLARATION
STANDALONE
VERSION