You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Nacho Conde <ic...@tid.es> on 2005/04/13 19:07:26 UTC

problem with XercesparerLiaison

Hi, i have a problem with XercesparerLiaison
if i use it, for parse a xml document the xpath expresion than i 
evaluate don´t work, the error is: "prefix must resolver to a namespace"
but if i use XalanSourceTreeParserLiaison with he same document and the 
same xpath expresion the evaluation works fine...,
i need use XercesParserLiaison for use the method mapToXercesDocument, 
<http://xml.apache.org/xalan-c/apiDocs/classXercesParserLiaison.html#a34>


Re: problem with XercesparerLiaison

Posted by Nacho Conde <ic...@tid.es>.
hi i compiled Xalan-c with the new XercesParserLiaison and now works 
fine! thanks for your help

When do you expect  the new  version of  xalanc to be available?

thanks


david_n_bertoni@us.ibm.com wrote:

>>Maybe i not explained me correctly,
>>in SerializeNodeSet sample
>>1. change the XalanSourcetreeParseLiaison  by XercesparseLiaison and 
>>XalanSourceTreeDomSupport by XercesDOMSupport
>>2. remove the line theDOMSupport.setParserLiaison(&Liaison)
>>3. evaluate this expresion /foo:doc/foo:name[1]
>>the result is No nodes matched the location path /foo:doc/foo:name[1]
>>and now if you undo the changes, and evalute the same expresion with 
>>XalanSourceTreeParseLiason the result is ok...
>>Can someone help me?
>>    
>>
>
>I've diagnosed this as a bug in XercesParserLiason.  Can you please open a 
>Jira defect that describes the problem?
>
>I will provide a patch later today, which I will attach to the Jira 
>report.
>
>Thanks!
>
>Dave
>
>__________ NOD32 1.1041 (20050330) Information __________
>
>This message was checked by NOD32 antivirus system.
>http://www.nod32.com
>
>
>
>  
>


Re: problem with XercesparerLiaison

Posted by da...@us.ibm.com.
> Maybe i not explained me correctly,
> in SerializeNodeSet sample
> 1. change the XalanSourcetreeParseLiaison  by XercesparseLiaison and 
> XalanSourceTreeDomSupport by XercesDOMSupport
> 2. remove the line theDOMSupport.setParserLiaison(&Liaison)
> 3. evaluate this expresion /foo:doc/foo:name[1]
> the result is No nodes matched the location path /foo:doc/foo:name[1]
> and now if you undo the changes, and evalute the same expresion with 
> XalanSourceTreeParseLiason the result is ok...
> Can someone help me?

I've diagnosed this as a bug in XercesParserLiason.  Can you please open a 
Jira defect that describes the problem?

I will provide a patch later today, which I will attach to the Jira 
report.

Thanks!

Dave

Re: problem with XercesparerLiaison

Posted by Nacho Conde <ic...@tid.es>.
Hi,
    i remove the setParserLiason statement because XercesDOMSupport 
don´t have this method.
    I try this, now
    expresion  /:doc/:name[1]
    this xml
    <?xml version="1.0"?>
 <doc>
   <name first="David" last="Marston">Mr. Marston</name>
 </doc>
 and the result is correct, <name first="David" last="Marston">Mr. 
Marston</name>

i don´t know how use namespaces whit XercesParserLiaison....

    we have a problem?


Jaspreet Singh wrote:

>If you remove the setParserLiason statement, how do you expect xalan to
>traverse the xerces tree?
>Try removing namespaces and then try to evaluate the expression. If it does,
>then we have a problem.
>
>[above suggestion is valid only if I am on the same page as you]
>
>
>On 4/15/05 5:51 PM, "Nacho Conde" <ic...@tid.es> wrote:
>
>  
>
>>Maybe i not explained me correctly,
>>in SerializeNodeSet sample
>>1. change the XalanSourcetreeParseLiaison  by XercesparseLiaison and
>>XalanSourceTreeDomSupport by XercesDOMSupport
>>2. remove the line theDOMSupport.setParserLiaison(&Liaison)
>>3. evaluate this expresion /foo:doc/foo:name[1]
>>the result is No nodes matched the location path /foo:doc/foo:name[1]
>>and now if you undo the changes, and evalute the same expresion with
>>XalanSourceTreeParseLiason the result is ok...
>>Can someone help me?
>>
>>Nacho Conde wrote:
>>
>>    
>>
>>>Sorry, here a code sample :
>>>the code of evaluator:
>>>
>>>    XObjectPtr xobject(theEvaluator.evaluate(
>>>                         theXercesDomSupport,
>>>                         theDocument.getDocumentElement(),
>>>                         XalanDOMString(xpathExpresion).c_str(),
>>>                         theDocument.getDocumentElement()));
>>>
>>>the xpath expresion
>>>/rdf:RDF/rdf:Description/prf:component
>>>
>>>the sample of xml
>>><?xml version="1.0" encoding="UTF-8" standalone="no" ?><rdf:RDF
>>>xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>>>xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-
>>>20021212#"
>>>xmlns:mms="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#"
>>>xmlns:tme="http://www.tsm.inet/ccppschematme-AAAAMMDD#">
>>><rdf:Description id="10000000">
>>>    <prf:component>
>>>        <rdf:Description id="BrowserUA">
>>>            <prf:BrowserName/>
>>>            <prf:BrowserVersion/>
>>>    </rdf:Description>
>>></prf:component></rdf:Description>
>>></rdf:RDF>  
>>>
>>>this expresion works ok,  whit XalanSourcetreeParserliaison, but when
>>>i use XercesParserLiaison dont work..
>>>the evalute method can´t see the namespaces, i think...
>>>
>>>david_n_bertoni@us.ibm.com wrote:
>>>
>>>      
>>>
>>>>>Hi, i have a problem with XercesparerLiaison
>>>>>if i use it, for parse a xml document the xpath expresion than i
>>>>>evaluate don´t work, the error is: "prefix must resolver to a
>>>>>namespace" but if i use XalanSourceTreeParserLiaison with he same
>>>>>document and the same xpath expresion the evaluation works fine...,
>>>>>i need use XercesParserLiaison for use the method mapToXercesDocument,
>>>>>   
>>>>>
>>>>>          
>>>>>
>>>>You need to provide a complete, _minimal_ code sample along with a sample
>>>>input document and XPath expression for anyone to help you.
>>>>
>>>>If you are constucting a Xerces DOM instance programmatically, you must
>>>>make sure you are creating a namespace-aware DOM.  If you are parsing to a
>>>>Xerces DOM instance, you need to make sure the parser you're using is
>>>>properly configured for namespace processing.
>>>>
>>>>Dave
>>>>
>>>>__________ NOD32 1.1041 (20050330) Information __________
>>>>
>>>>This message was checked by NOD32 antivirus system.
>>>>http://www.nod32.com
>>>>
>>>>
>>>>
>>>> 
>>>>
>>>>        
>>>>
>>>
>>>__________ NOD32 1.1041 (20050330) Information __________
>>>
>>>This message was checked by NOD32 antivirus system.
>>>http://www.nod32.com
>>>      
>>>
>>    
>>
>
>
>__________ NOD32 1.1041 (20050330) Information __________
>
>This message was checked by NOD32 antivirus system.
>http://www.nod32.com
>
>
>
>  
>


Re: problem with XercesparerLiaison

Posted by Jaspreet Singh <Ja...@quark.com>.
If you remove the setParserLiason statement, how do you expect xalan to
traverse the xerces tree?
Try removing namespaces and then try to evaluate the expression. If it does,
then we have a problem.

[above suggestion is valid only if I am on the same page as you]


On 4/15/05 5:51 PM, "Nacho Conde" <ic...@tid.es> wrote:

> Maybe i not explained me correctly,
> in SerializeNodeSet sample
> 1. change the XalanSourcetreeParseLiaison  by XercesparseLiaison and
> XalanSourceTreeDomSupport by XercesDOMSupport
> 2. remove the line theDOMSupport.setParserLiaison(&Liaison)
> 3. evaluate this expresion /foo:doc/foo:name[1]
> the result is No nodes matched the location path /foo:doc/foo:name[1]
> and now if you undo the changes, and evalute the same expresion with
> XalanSourceTreeParseLiason the result is ok...
> Can someone help me?
> 
> Nacho Conde wrote:
> 
>> Sorry, here a code sample :
>> the code of evaluator:
>> 
>>     XObjectPtr xobject(theEvaluator.evaluate(
>>                          theXercesDomSupport,
>>                          theDocument.getDocumentElement(),
>>                          XalanDOMString(xpathExpresion).c_str(),
>>                          theDocument.getDocumentElement()));
>> 
>> the xpath expresion
>> /rdf:RDF/rdf:Description/prf:component
>> 
>> the sample of xml
>> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><rdf:RDF
>> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>> xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-
>> 20021212#"
>> xmlns:mms="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#"
>> xmlns:tme="http://www.tsm.inet/ccppschematme-AAAAMMDD#">
>> <rdf:Description id="10000000">
>>     <prf:component>
>>         <rdf:Description id="BrowserUA">
>>             <prf:BrowserName/>
>>             <prf:BrowserVersion/>
>>     </rdf:Description>
>> </prf:component></rdf:Description>
>> </rdf:RDF>  
>> 
>> this expresion works ok,  whit XalanSourcetreeParserliaison, but when
>> i use XercesParserLiaison dont work..
>> the evalute method can´t see the namespaces, i think...
>> 
>> david_n_bertoni@us.ibm.com wrote:
>> 
>>>> Hi, i have a problem with XercesparerLiaison
>>>> if i use it, for parse a xml document the xpath expresion than i
>>>> evaluate don´t work, the error is: "prefix must resolver to a
>>>> namespace" but if i use XalanSourceTreeParserLiaison with he same
>>>> document and the same xpath expresion the evaluation works fine...,
>>>> i need use XercesParserLiaison for use the method mapToXercesDocument,
>>>>    
>>>> 
>>> 
>>> You need to provide a complete, _minimal_ code sample along with a sample
>>> input document and XPath expression for anyone to help you.
>>> 
>>> If you are constucting a Xerces DOM instance programmatically, you must
>>> make sure you are creating a namespace-aware DOM.  If you are parsing to a
>>> Xerces DOM instance, you need to make sure the parser you're using is
>>> properly configured for namespace processing.
>>> 
>>> Dave
>>> 
>>> __________ NOD32 1.1041 (20050330) Information __________
>>> 
>>> This message was checked by NOD32 antivirus system.
>>> http://www.nod32.com
>>> 
>>> 
>>> 
>>>  
>>> 
>> 
>> 
>> 
>> __________ NOD32 1.1041 (20050330) Information __________
>> 
>> This message was checked by NOD32 antivirus system.
>> http://www.nod32.com
> 
> 


Re: problem with XercesparerLiaison

Posted by Nacho Conde <ic...@tid.es>.
Maybe i not explained me correctly,
in SerializeNodeSet sample
1. change the XalanSourcetreeParseLiaison  by XercesparseLiaison and 
XalanSourceTreeDomSupport by XercesDOMSupport
2. remove the line theDOMSupport.setParserLiaison(&Liaison)
3. evaluate this expresion /foo:doc/foo:name[1]
the result is No nodes matched the location path /foo:doc/foo:name[1]
and now if you undo the changes, and evalute the same expresion with 
XalanSourceTreeParseLiason the result is ok...
Can someone help me?

Nacho Conde wrote:

> Sorry, here a code sample :
> the code of evaluator:
>
>     XObjectPtr xobject(theEvaluator.evaluate(
>                          theXercesDomSupport,
>                          theDocument.getDocumentElement(),
>                          XalanDOMString(xpathExpresion).c_str(),
>                          theDocument.getDocumentElement()));
>
> the xpath expresion
> /rdf:RDF/rdf:Description/prf:component
>
> the sample of xml
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><rdf:RDF
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#"
> xmlns:mms="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#"
> xmlns:tme="http://www.tsm.inet/ccppschematme-AAAAMMDD#">
> <rdf:Description id="10000000">
>     <prf:component>
>         <rdf:Description id="BrowserUA">
>             <prf:BrowserName/>
>             <prf:BrowserVersion/>
>     </rdf:Description>
> </prf:component></rdf:Description>
> </rdf:RDF>  
>
> this expresion works ok,  whit XalanSourcetreeParserliaison, but when 
> i use XercesParserLiaison dont work..
> the evalute method can´t see the namespaces, i think...
>
> david_n_bertoni@us.ibm.com wrote:
>
>>>Hi, i have a problem with XercesparerLiaison
>>>if i use it, for parse a xml document the xpath expresion than i
>>>evaluate don´t work, the error is: "prefix must resolver to a
>>>namespace" but if i use XalanSourceTreeParserLiaison with he same
>>>document and the same xpath expresion the evaluation works fine..., 
>>>i need use XercesParserLiaison for use the method mapToXercesDocument, 
>>>    
>>>
>>
>>You need to provide a complete, _minimal_ code sample along with a sample 
>>input document and XPath expression for anyone to help you.
>>
>>If you are constucting a Xerces DOM instance programmatically, you must 
>>make sure you are creating a namespace-aware DOM.  If you are parsing to a 
>>Xerces DOM instance, you need to make sure the parser you're using is 
>>properly configured for namespace processing.
>>
>>Dave
>>
>>__________ NOD32 1.1041 (20050330) Information __________
>>
>>This message was checked by NOD32 antivirus system.
>>http://www.nod32.com
>>
>>
>>
>>  
>>
>
>
>
> __________ NOD32 1.1041 (20050330) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com



Re: problem with XercesparerLiaison

Posted by Nacho Conde <ic...@tid.es>.
Sorry, here a code sample :
the code of evaluator:

    XObjectPtr xobject(theEvaluator.evaluate(
                         theXercesDomSupport,
                         theDocument.getDocumentElement(),
                         XalanDOMString(xpathExpresion).c_str(),
                         theDocument.getDocumentElement()));

the xpath expresion
/rdf:RDF/rdf:Description/prf:component

the sample of xml
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#"
xmlns:mms="http://www.wapforum.org/profiles/MMS/ccppschema-20010111#"
xmlns:tme="http://www.tsm.inet/ccppschematme-AAAAMMDD#">
<rdf:Description id="10000000">
    <prf:component>
        <rdf:Description id="BrowserUA">
            <prf:BrowserName/>
            <prf:BrowserVersion/>
    </rdf:Description>
</prf:component></rdf:Description>
</rdf:RDF>  

this expresion works ok,  whit XalanSourcetreeParserliaison, but when i 
use XercesParserLiaison dont work..
the evalute method can´t see the namespaces, i think...

david_n_bertoni@us.ibm.com wrote:

>>Hi, i have a problem with XercesparerLiaison
>>if i use it, for parse a xml document the xpath expresion than i
>>evaluate don´t work, the error is: "prefix must resolver to a
>>namespace" but if i use XalanSourceTreeParserLiaison with he same
>>document and the same xpath expresion the evaluation works fine..., 
>>i need use XercesParserLiaison for use the method mapToXercesDocument, 
>>    
>>
>
>You need to provide a complete, _minimal_ code sample along with a sample 
>input document and XPath expression for anyone to help you.
>
>If you are constucting a Xerces DOM instance programmatically, you must 
>make sure you are creating a namespace-aware DOM.  If you are parsing to a 
>Xerces DOM instance, you need to make sure the parser you're using is 
>properly configured for namespace processing.
>
>Dave
>
>__________ NOD32 1.1041 (20050330) Information __________
>
>This message was checked by NOD32 antivirus system.
>http://www.nod32.com
>
>
>
>  
>


Re: problem with XercesparerLiaison

Posted by da...@us.ibm.com.
> Hi, i have a problem with XercesparerLiaison
> if i use it, for parse a xml document the xpath expresion than i
> evaluate don´t work, the error is: "prefix must resolver to a
> namespace" but if i use XalanSourceTreeParserLiaison with he same
> document and the same xpath expresion the evaluation works fine..., 
> i need use XercesParserLiaison for use the method mapToXercesDocument, 

You need to provide a complete, _minimal_ code sample along with a sample 
input document and XPath expression for anyone to help you.

If you are constucting a Xerces DOM instance programmatically, you must 
make sure you are creating a namespace-aware DOM.  If you are parsing to a 
Xerces DOM instance, you need to make sure the parser you're using is 
properly configured for namespace processing.

Dave