com.helger.xml.serialize.write.XMLWriterSettings.setNamespaceContext()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中com.helger.xml.serialize.write.XMLWriterSettings.setNamespaceContext()方法的一些代码示例,展示了XMLWriterSettings.setNamespaceContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLWriterSettings.setNamespaceContext()方法的具体详情如下:
包路径:com.helger.xml.serialize.write.XMLWriterSettings
类名称:XMLWriterSettings
方法名:setNamespaceContext

XMLWriterSettings.setNamespaceContext介绍

[英]Set the namespace context to be used.
[中]设置要使用的命名空间上下文。

代码示例

代码示例来源:origin: phax/ph-schematron

aXWS.setNamespaceContext (aNSContext).setPutNamespaceContextPrefixesInRoot (true);

代码示例来源:origin: com.helger/ph-jaxb

/**
 * @return The XML writer settings to be used based on this writer settings.
 *         Never <code>null</code>.
 */
@Nonnull
default IXMLWriterSettings getXMLWriterSettings ()
{
 final XMLWriterSettings ret = new XMLWriterSettings ().setNamespaceContext (getNamespaceContext ())
                            .setIndent (isFormattedOutput () ? EXMLSerializeIndent.INDENT_AND_ALIGN
                                             : EXMLSerializeIndent.NONE);
 if (hasIndentString ())
  ret.setIndentationString (getIndentString ());
 if (hasCharset ())
  ret.setCharset (getCharset ());
 return ret.setNewLineMode (ENewLineMode.DEFAULT)
      .setIncorrectCharacterHandling (EXMLIncorrectCharacterHandling.DO_NOT_WRITE_LOG_WARNING);
}

代码示例来源:origin: com.helger/ph-xml

/**
 * Copy constructor.
 *
 * @param aOther
 *        The object to copy the settings from. May not be <code>null</code>.
 */
public XMLWriterSettings (@Nonnull final IXMLWriterSettings aOther)
{
 ValueEnforcer.notNull (aOther, "Other");
 setSerializeVersion (aOther.getSerializeVersion ());
 setSerializeXMLDeclaration (aOther.getSerializeXMLDeclaration ());
 setSerializeDocType (aOther.getSerializeDocType ());
 setSerializeComments (aOther.getSerializeComments ());
 setIndent (aOther.getIndent ());
 setIndentDeterminator (aOther.getIndentDeterminator ());
 setIncorrectCharacterHandling (aOther.getIncorrectCharacterHandling ());
 setCharset (aOther.getCharset ());
 setNamespaceContext (aOther.getNamespaceContext ());
 setBracketModeDeterminator (aOther.getBracketModeDeterminator ());
 setUseDoubleQuotesForAttributes (aOther.isUseDoubleQuotesForAttributes ());
 setSpaceOnSelfClosedElement (aOther.isSpaceOnSelfClosedElement ());
 setNewLineMode (aOther.getNewLineMode ());
 setIndentationString (aOther.getIndentationString ());
 setEmitNamespaces (aOther.isEmitNamespaces ());
 setPutNamespaceContextPrefixesInRoot (aOther.isPutNamespaceContextPrefixesInRoot ());
 setWriteCDATAAsText (aOther.isWriteCDATAAsText ());
 setOrderAttributesAndNamespaces (aOther.isOrderAttributesAndNamespaces ());
}

相关文章