You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by João Marcelo Loureiro do Amaral <jo...@infocon.com.br> on 2001/06/21 15:01:24 UTC

Problems with XML files...

Hi,
    I'm using Xerces-C to parse my XML Files. But if the files is
formated with ENTER at final of each XML tags, the DOM Parser get the
ENTER like a child node. How can I do to formated my XML files with
ENTER at final of the tags, without any problems.

Thank's
João M L Amaral
Brazil

Re: Problems with XML files...

Posted by João Marcelo Loureiro do Amaral <jo...@infocon.com.br>.
Ryan, I found how to do it...
It's same to SAXParser.
Thank you very much.


Ryan Roleda wrote:

> Hello Jao, I think, first you have to store the data in the xml file
> into your buffer, then you simply parse it.  You have to do something
> like reading the file and store it to some String type of variable,
> try checking the file access functions for reference in storing data
> in files into some buffer. Im not sure if this is what you meant. But,
> you can check the MemParse example.... If u still have probs just mail
> me.... at ur service,ryan
>
>      ----- Original Message -----
>      From: João Marcelo Loureiro do Amaral
>      To: Ryan B. Roleda
>      Cc: xerces-c-dev@xml.apache.org
>      Sent: Thursday, June 28, 2001 4:45 AM
>      Subject: Re: Problems with XML files...
>       Dear Ryan,
>          I'd like you help me again...
>          At moment I'm using the DOMParser Classes for parse xml
>      files. But I´m needing to parse a buffer in memory. How can
>      I do it ?
>          I tried to use the parse (  const InputSource & source,
>      const bool reuseValidator = false ) method of DOMParser, but
>      I didn't have sucess...
>
>      wait for your return.
>      Thak you.
>      João M L Amaral
>
>
>      "Ryan B. Roleda" wrote:
>
>     > Joao,
>     >
>     > Morning to You.....
>     >
>     > Hello There.... I encountered this before.... an ENTER or
>     > New Line character
>     > is a "Node.TEXT_NODE" type. So in order for u to just
>     > skipped whenever this
>     > type is encountered, in your loop you have to put
>     > something like:
>     >
>     >     for (y = 0 ; y < count ; y++)
>     >     {
>     >         node = childNodes.item(y);
>     >         nodeType = node.getNodeType();
>     >         if (nodeType != Node.TEXT_NODE)
>     >         {
>     >             nodeName = node.getNodeName();
>     >             attrMap  = node.getAttributes();
>     >             .
>     >             .
>     >             .
>     >         }
>     >         .
>     >         .
>     >         .
>     >     }
>     >
>     > Check out the DOM tutorial to know more about Node Types
>     >
>     > Hope this will help............
>     >
>     > ----- Original Message -----
>     > From: "João Marcelo Loureiro do Amaral"
>     > <jo...@infocon.com.br>
>     > To: <xe...@xml.apache.org>
>     > Sent: Thursday, June 21, 2001 10:01 PM
>     > Subject: Problems with XML files...
>     >
>     > Hi,
>     >     I'm using Xerces-C to parse my XML Files. But if the
>     > files is
>     > formated with ENTER at final of each XML tags, the DOM
>     > Parser get the
>     > ENTER like a child node. How can I do to formated my XML
>     > files with
>     > ENTER at final of the tags, without any problems.
>     >
>     > Thank's
>     > João M L Amaral
>     > Brazil
>     >
>     > ------
>     > ---------------------------------------------------------------------
>     >
>     > ----
>     >
>     > >
>     > ---------------------------------------------------------------------
>     >
>     > > To unsubscribe, e-mail:
>     > xerces-c-dev-unsubscribe@xml.apache.org
>     > > For additional commands, e-mail:
>     > xerces-c-dev-help@xml.apache.org
>
>      -------------------------------------------------------------
>
>      ---------------------------------------------------------------------
>
>      To unsubscribe, e-mail:
>      xerces-c-dev-unsubscribe@xml.apache.org
>      For additional commands, e-mail:
>      xerces-c-dev-help@xml.apache.org
>

Re: Problems with XML files...

Posted by Ryan Roleda <ry...@nmd.mt.nec.co.jp>.
Hello Jao,

I think, first you have to store the data in the xml file into your buffer, then you simply parse it.  You have to do something like reading the file and store it to some String type of variable, try checking the file access functions for reference in storing data in files into some buffer.

Im not sure if this is what you meant. But, you can check the MemParse example.... If u still have probs just mail me....

at ur service,
ryan

  ----- Original Message ----- 
  From: João Marcelo Loureiro do Amaral 
  To: Ryan B. Roleda 
  Cc: xerces-c-dev@xml.apache.org 
  Sent: Thursday, June 28, 2001 4:45 AM
  Subject: Re: Problems with XML files...


  Dear Ryan, 
      I'd like you help me again... 
      At moment I'm using the DOMParser Classes for parse xml files. But I´m needing to parse a buffer in memory. How can I do it ? 
      I tried to use the parse (  const InputSource & source, const bool reuseValidator = false ) method of DOMParser, but I didn't have sucess... 
    
  wait for your return. 
  Thak you. 
  João M L Amaral 
    
  "Ryan B. Roleda" wrote: 

    Joao, 
    Morning to You..... 

    Hello There.... I encountered this before.... an ENTER or New Line character 
    is a "Node.TEXT_NODE" type. So in order for u to just skipped whenever this 
    type is encountered, in your loop you have to put something like: 

        for (y = 0 ; y < count ; y++) 
        { 
            node = childNodes.item(y); 
            nodeType = node.getNodeType(); 
            if (nodeType != Node.TEXT_NODE) 
            { 
                nodeName = node.getNodeName(); 
                attrMap  = node.getAttributes(); 
                . 
                . 
                . 
            } 
            . 
            . 
            . 
        } 

    Check out the DOM tutorial to know more about Node Types 

    Hope this will help............ 

    ----- Original Message ----- 
    From: "João Marcelo Loureiro do Amaral" <jo...@infocon.com.br> 
    To: <xe...@xml.apache.org> 
    Sent: Thursday, June 21, 2001 10:01 PM 
    Subject: Problems with XML files... 

    Hi, 
        I'm using Xerces-C to parse my XML Files. But if the files is 
    formated with ENTER at final of each XML tags, the DOM Parser get the 
    ENTER like a child node. How can I do to formated my XML files with 
    ENTER at final of the tags, without any problems. 

    Thank's 
    João M L Amaral 
    Brazil 

    ---------------------------------------------------------------------------- 
    ---- 

    > --------------------------------------------------------------------- 
    > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org 
    > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



------------------------------------------------------------------------------


  ---------------------------------------------------------------------
  To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
  For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

Re: Problems with XML files...

Posted by João Marcelo Loureiro do Amaral <jo...@infocon.com.br>.
Dear Ryan,
    I'd like you help me again...
    At moment I'm using the DOMParser Classes for parse xml files. But I´m
needing to parse a buffer in memory. How can I do it ?
    I tried to use the parse (  const InputSource & source, const bool
reuseValidator = false ) method of DOMParser, but I didn't have sucess...

wait for your return.
Thak you.
João M L Amaral


"Ryan B. Roleda" wrote:

> Joao,
>
> Morning to You.....
>
> Hello There.... I encountered this before.... an ENTER or New Line character
> is a "Node.TEXT_NODE" type. So in order for u to just skipped whenever this
> type is encountered, in your loop you have to put something like:
>
>     for (y = 0 ; y < count ; y++)
>     {
>         node = childNodes.item(y);
>         nodeType = node.getNodeType();
>         if (nodeType != Node.TEXT_NODE)
>         {
>             nodeName = node.getNodeName();
>             attrMap  = node.getAttributes();
>             .
>             .
>             .
>         }
>         .
>         .
>         .
>     }
>
> Check out the DOM tutorial to know more about Node Types
>
> Hope this will help............
>
> ----- Original Message -----
> From: "João Marcelo Loureiro do Amaral" <jo...@infocon.com.br>
> To: <xe...@xml.apache.org>
> Sent: Thursday, June 21, 2001 10:01 PM
> Subject: Problems with XML files...
>
> Hi,
>     I'm using Xerces-C to parse my XML Files. But if the files is
> formated with ENTER at final of each XML tags, the DOM Parser get the
> ENTER like a child node. How can I do to formated my XML files with
> ENTER at final of the tags, without any problems.
>
> Thank's
> João M L Amaral
> Brazil
>
> ----------------------------------------------------------------------------
> ----
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

Re: Problems with XML files...

Posted by "Ryan B. Roleda" <ry...@nmd.mt.nec.co.jp>.
Joao,

Morning to You.....

Hello There.... I encountered this before.... an ENTER or New Line character
is a "Node.TEXT_NODE" type. So in order for u to just skipped whenever this
type is encountered, in your loop you have to put something like:

    for (y = 0 ; y < count ; y++)
    {
        node = childNodes.item(y);
        nodeType = node.getNodeType();
        if (nodeType != Node.TEXT_NODE)
        {
            nodeName = node.getNodeName();
            attrMap  = node.getAttributes();
            .
            .
            .
        }
        .
        .
        .
    }

Check out the DOM tutorial to know more about Node Types

Hope this will help............


----- Original Message -----
From: "João Marcelo Loureiro do Amaral" <jo...@infocon.com.br>
To: <xe...@xml.apache.org>
Sent: Thursday, June 21, 2001 10:01 PM
Subject: Problems with XML files...


Hi,
    I'm using Xerces-C to parse my XML Files. But if the files is
formated with ENTER at final of each XML tags, the DOM Parser get the
ENTER like a child node. How can I do to formated my XML files with
ENTER at final of the tags, without any problems.

Thank's
João M L Amaral
Brazil



----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org