hi
referring to my code snippet, the value of href is a String
"data:<fas><fasi>asd</fasi></fas>"
the string is this... and i dont think there is an error in this.. or
is there an error?

Also, can u please suggest some way to debug this problem....


thanx
fasih

On Mon, 31 Jan 2005 13:20:48 -0800, John Gentilin
<[EMAIL PROTECTED]> wrote:
> Are you receiving the string you expect inside the resolver i.e. Are the
> entities coming through as
> entities or the resolved  characters ?? This looks like one of those
> thing where you are going to
> have conflicts on entity expansion. How do you populate the string ??
> 
> It may help to debug by parsing the string with a DOM parser then pass
> back a DOMSource.
> If you force the parsing to occur in the resolver it may give you better
> insight on what is happening.
> 
> -John G
> 
> 
> Fasihullah Askiri wrote:
> 
> >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