开发者

Java Transformer with parameter

开发者 https://www.devze.com 2023-02-22 06:42 出处:网络
I\'m using Java (JAXP) for XML transforma开发者_JAVA百科tion and I need to pass a fragment of xml as parameter to the transformer:

I'm using Java (JAXP) for XML transforma开发者_JAVA百科tion and I need to pass a fragment of xml as parameter to the transformer:

<DOCTYPES>
    <SUBTYPE>Passport</SUBTYPE>
    <DOCTYPE>Proof of identity</DOCTYPE>
</DOCTYPES>
<DOCTYPES>
    <SUBTYPE>Driving License</SUBTYPE>
    <DOCTYPE>Proof of address</DOCTYPE>
</DOCTYPES>

Let's say xmlfrag contains the above piece of xml. I pass it to the transformer:

transformer.setParameter("orset", xmlfrag);

What is the type that xmlfrag needs to be so I can access it as xml during the transformation? I tried string and xmltype but no luck.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号