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.
精彩评论