Hi all
I have a string variable that contains xml in it. I want to parse it
and use a particular node in my xsl processing. I tried writing a
URIResolver so that I can do a document() and get it parsed, but I am
getting a strange behaviour, what I get is only the text node as
string back from the document(). Please tell me where I am wrong or
how should I do it best.

Code snippet:
My resolver class:

public class DataResolver implements URIResolver{
    public Source resolve(String href, String base) throws
TransformerException {
        try {
            if(href.startsWith("data:";)) {
                StreamSource s = new StreamSource(new
StringReader(href.substring(5)));
                 return s;
            }
        } catch(Exception ie){
            System.out.println("Problem" + ie.getMessage());
        }
        return null;
    }
}



My xsl:
<xsl:value-of select="document('data:'&lt;?xml
version=&quot;1.0&quot;?>&lt;fas>&lt;fasi>Fasih&lt;/fasi>&lt;/fas>')"/>

returns Fasih
rather than, <fas><fasi>Fasih</fasi></fas> as a node-set.

Please help me on this, I was so desperate on this that I even
downloaded the xalan src code to figure out what was wrong.

Thanx in advance for any help
Fasih

Reply via email to