开发者

Java Transformer with parameter

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜