You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Tammo Mueller <ta...@gmail.com> on 2005/05/12 05:57:04 UTC

getDomNode() #text

Hi guys!
 
I'm trying to traverse my DOM-tree and recognized a strange behavior:
 
First of a code snippet:
 
ProjectDocument poDoc = null;
...
poDoc = ProjectDocument.Factory.parse(f);
 
//Debug
Node n = poDoc.getProject().getDomNode();
NodeList list = n.getChildNodes();
  for (int k =0; k < list.getLength();k++){
    System.out.println(list.item(k).getNodeName());
 }
 
output:
 
#text
name
#text
description
#text
projectmanager
#text

My XML File is like this:
 
<project xsi:schemaLocation="... <http://siemens.de/project>
C:\mySchema.xsd">
    <name>...</name>
     <description>
    ...
    </description>

     <projectmanager>
        <firstname>John</firstname>
        <surname>Doe</surname>
    </projectmanager>
...
Does anyone have a clue?
 
Best regards, 
 
Tammo
 

Re: AW: getDomNode() #text

Posted by Serge <te...@udm.ru>.
Hi, Tammo.

As far as I know, XML <-> DOM is mutually inverse
transformation. It means that for each XML-document there
is only one DOM model and for two different XML-documents
there are two different models. If I am right, #text nodes
should appear in DOM-tree. But may be I am wrong. I think
you should refer to the W3C Recommendation to make it
clear. Please tell if you find a correct answer.

On Thu, 12 May 2005 00:51:17 -0400
 "Tammo Mueller" <ta...@gmail.com> wrote:
> Hi Serge,
> 
> But spaces and line breaks shouldn't appear in a DOM. The
> Dom should only
> contain the metainformation (elements + attributes) and
> the corresponding
> values and their relation to each other.
> Am I wrong?
> 
> Tammo 
> 
> -----Ursprüngliche Nachricht-----
> Von: Serge [mailto:teron@udm.ru] 
> Gesendet: Donnerstag, 12. Mai 2005 00:10
> An: user@xmlbeans.apache.org
> Betreff: Re: getDomNode() #text
> 
> Hi.
> 
> I don't see anything strange here. You have spaces and
> linebreaks in your XML-document and they are represented
> as
> #text nodes. It is normal behaviour, I think.
> 
> On Wed, 11 May 2005 23:57:04 -0400
>  "Tammo Mueller" <ta...@gmail.com> wrote:
> > Hi guys!
> >  
> > I'm trying to traverse my DOM-tree and recognized a
> > strange behavior:
> >  
> > First of a code snippet:
> >  
> > ProjectDocument poDoc = null;
> > ...
> > poDoc = ProjectDocument.Factory.parse(f);
> >  
> > //Debug
> > Node n = poDoc.getProject().getDomNode();
> > NodeList list = n.getChildNodes();
> >   for (int k =0; k < list.getLength();k++){
> >     System.out.println(list.item(k).getNodeName());
> >  }
> >  
> > output:
> >  
> > #text
> > name
> > #text
> > description
> > #text
> > projectmanager
> > #text
> > 
> > My XML File is like this:
> >  
> > <project xsi:schemaLocation="...
> > <http://siemens.de/project>
> > C:\mySchema.xsd">
> >     <name>...</name>
> >      <description>
> >     ...
> >     </description>
> > 
> >      <projectmanager>
> >         <firstname>John</firstname>
> >         <surname>Doe</surname>
> >     </projectmanager>
> > ...
> > Does anyone have a clue?
> >  
> > Best regards, 
> >  
> > Tammo
> >  
> 
> _____
> Best Regards, Serge.
> mailto:teron@udm.ru
> ICQ 315293596
> 
> "СОЛО на клавиатуре" - обучение слепому де
> сятипальцевому
> набору
> Для получения информации посетите, пожал
> уйста, сайт
> http://www.ergosolo.ru
> ----------------------------------------------------
> Треть суток на треть дешевле!
> МАРК-ИТТ ввёл льготные цены на ночной тра
> фик в Народном Интернете
> цены на трафик на 30% ниже дневных в период
> с 1:00 до 9:00.
> 600-й - 1.75р, Профессиональный - 1.89р, Деловой -
> 1.96р, 5-ка - 2,03р, Домашний - 2,10р
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail:
> user-help@xmlbeans.apache.org

_____
Best Regards, Serge.
mailto:teron@udm.ru
ICQ 315293596

"СОЛО на клавиатуре" - обучение слепому десятипальцевому
набору
Для получения информации посетите, пожалуйста, сайт
http://www.ergosolo.ru
----------------------------------------------------
Треть суток на треть дешевле!
МАРК-ИТТ ввёл льготные цены на ночной трафик в Народном Интернете
цены на трафик на 30% ниже дневных в период с 1:00 до 9:00.
600-й - 1.75р, Профессиональный - 1.89р, Деловой - 1.96р, 5-ка - 2,03р, Домашний - 2,10р

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


AW: getDomNode() #text

Posted by Tammo Mueller <ta...@gmail.com>.
Hi Serge,

But spaces and line breaks shouldn't appear in a DOM. The Dom should only
contain the metainformation (elements + attributes) and the corresponding
values and their relation to each other.
Am I wrong?

Tammo 

-----Ursprüngliche Nachricht-----
Von: Serge [mailto:teron@udm.ru] 
Gesendet: Donnerstag, 12. Mai 2005 00:10
An: user@xmlbeans.apache.org
Betreff: Re: getDomNode() #text

Hi.

I don't see anything strange here. You have spaces and
linebreaks in your XML-document and they are represented as
#text nodes. It is normal behaviour, I think.

On Wed, 11 May 2005 23:57:04 -0400
 "Tammo Mueller" <ta...@gmail.com> wrote:
> Hi guys!
>  
> I'm trying to traverse my DOM-tree and recognized a
> strange behavior:
>  
> First of a code snippet:
>  
> ProjectDocument poDoc = null;
> ...
> poDoc = ProjectDocument.Factory.parse(f);
>  
> //Debug
> Node n = poDoc.getProject().getDomNode();
> NodeList list = n.getChildNodes();
>   for (int k =0; k < list.getLength();k++){
>     System.out.println(list.item(k).getNodeName());
>  }
>  
> output:
>  
> #text
> name
> #text
> description
> #text
> projectmanager
> #text
> 
> My XML File is like this:
>  
> <project xsi:schemaLocation="...
> <http://siemens.de/project>
> C:\mySchema.xsd">
>     <name>...</name>
>      <description>
>     ...
>     </description>
> 
>      <projectmanager>
>         <firstname>John</firstname>
>         <surname>Doe</surname>
>     </projectmanager>
> ...
> Does anyone have a clue?
>  
> Best regards, 
>  
> Tammo
>  

_____
Best Regards, Serge.
mailto:teron@udm.ru
ICQ 315293596

"СОЛО на клавиатуре" - обучение слепому де
сятипальцевому
набору
Для получения информации посетите, пожал
уйста, сайт
http://www.ergosolo.ru
----------------------------------------------------
Треть суток на треть дешевле!
МАРК-ИТТ ввёл льготные цены на ночной тра
фик в Народном Интернете
цены на трафик на 30% ниже дневных в период
с 1:00 до 9:00.
600-й - 1.75р, Профессиональный - 1.89р, Деловой -
1.96р, 5-ка - 2,03р, Домашний - 2,10р

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org

Re: getDomNode() #text

Posted by Serge <te...@udm.ru>.
Hi.

I don't see anything strange here. You have spaces and
linebreaks in your XML-document and they are represented as
#text nodes. It is normal behaviour, I think.

On Wed, 11 May 2005 23:57:04 -0400
 "Tammo Mueller" <ta...@gmail.com> wrote:
> Hi guys!
>  
> I'm trying to traverse my DOM-tree and recognized a
> strange behavior:
>  
> First of a code snippet:
>  
> ProjectDocument poDoc = null;
> ...
> poDoc = ProjectDocument.Factory.parse(f);
>  
> //Debug
> Node n = poDoc.getProject().getDomNode();
> NodeList list = n.getChildNodes();
>   for (int k =0; k < list.getLength();k++){
>     System.out.println(list.item(k).getNodeName());
>  }
>  
> output:
>  
> #text
> name
> #text
> description
> #text
> projectmanager
> #text
> 
> My XML File is like this:
>  
> <project xsi:schemaLocation="...
> <http://siemens.de/project>
> C:\mySchema.xsd">
>     <name>...</name>
>      <description>
>     ...
>     </description>
> 
>      <projectmanager>
>         <firstname>John</firstname>
>         <surname>Doe</surname>
>     </projectmanager>
> ...
> Does anyone have a clue?
>  
> Best regards, 
>  
> Tammo
>  

_____
Best Regards, Serge.
mailto:teron@udm.ru
ICQ 315293596

"СОЛО на клавиатуре" - обучение слепому десятипальцевому
набору
Для получения информации посетите, пожалуйста, сайт
http://www.ergosolo.ru
----------------------------------------------------
Треть суток на треть дешевле!
МАРК-ИТТ ввёл льготные цены на ночной трафик в Народном Интернете
цены на трафик на 30% ниже дневных в период с 1:00 до 9:00.
600-й - 1.75р, Профессиональный - 1.89р, Деловой - 1.96р, 5-ка - 2,03р, Домашний - 2,10р

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org