As Joe's previous message made clear, and I thought I had made clear,
trying to search an XML document using XPath won't work.  CData sections
are not part of the model, and there's no XPath that you can write that
will find them.

I only mentioned using the Xerces DOM because it at least allows CDATA
sections to be represented.  If you can't use Joe's previous suggestion,
you'll have to search the DOM yourself.

Dave



|---------+--------------------------->
|         |           "Williamson,    |
|         |           Siehnai"        |
|         |           <swilliamson@doc|
|         |           ucorp.com>      |
|         |                           |
|         |           04/26/2002 10:24|
|         |           AM              |
|         |           Please respond  |
|         |           to xalan-dev    |
|         |                           |
|---------+--------------------------->
  
>---------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                       |
  |        To:      "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>            
                                       |
  |        cc:      (bcc: David N Bertoni/Cambridge/IBM)                               
                                       |
  |        Subject: RE: XalanNode->getNodeType() returns text when CData               
                                       |
  
>---------------------------------------------------------------------------------------------------------------------------|



I mean that the chunk of data as displayed in the xml document is a CData
section.


      "If you're using the Xerces DOM and our wrapper around that, you can


preserve CDATA sections"


How would I be able to do this?


      -----Original Message-----
      From:   David N Bertoni/Cambridge/IBM
      [SMTP:[EMAIL PROTECTED]]
      Sent:   Friday, April 26, 2002 12:19 PM
      To:     [EMAIL PROTECTED]
      Subject:        Re: XalanNode->getNodeType() returns text when CData





      Can you explain more what you mean when you say "the data is clearly
      CDATA"?  The XPath data model has no notion of CDATA sections, so any

      characters inside a CDATA section will have been merged with any
      surrounding characters into one text node when we build the tree.


      If you're using the Xerces DOM and our wrapper around that, you can
      preserve CDATA sections, but searching for them using XPath may not
      work as
      expected.  This is just one of the differences between the DOM and
      the
      XPath data model, so I'm not sure what the "fix" would be.


      Dave






      |---------+--------------------------->
      |         |           "Williamson,    |
      |         |           Siehnai"        |
      |         |           <swilliamson@doc|
      |         |           ucorp.com>      |
      |         |                           |
      |         |           04/26/2002 08:31|
      |         |           AM              |
      |         |           Please respond  |
      |         |           to xalan-dev    |
      |         |                           |
      |---------+--------------------------->
        >
      
---------------------------------------------------------------------------------------------------------------------------|


        |
      |


        |        To:      "'[EMAIL PROTECTED]'"
      <[EMAIL PROTECTED]>
      |


        |        cc:      (bcc: David N Bertoni/Cambridge/IBM)
      |


        |        Subject: XalanNode->getNodeType() returns text when CData
      |


        >
      
---------------------------------------------------------------------------------------------------------------------------|









      Hi,





      Whenever I use XalanNode->getNodeType() in the XPathWrapper example
      it
      returns a type XalanNode::TEXT_NODE rather than
      XalanNode::CDATA_SECTION_NODE when the data is clearly CData.  The
      other
      types work as they should and return the appropriate node types.





      I am doing special processing for CData Sections in my application.
      Is
      there another way to distinguish in  XalanNode whether the data is
      CData or
      not, or do I have to wait for a fix?





      Thanks,
      Siehnai














Reply via email to