You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Swanson, Brion" <Br...@westgroup.com> on 2002/12/13 00:08:05 UTC

RE: Question on Feature: http://apache.org/xml/features/dom/incl ude-ignorable-whitespace

Hi Rob,

Aside from the wonderful discussion of what is ignorable whitespace and what
is not that Sandy and Joe have provided, your five children are thus:

<keys>
<!-- child #1: newline / whitespace -->
<!-- child #2: --> <key name="foo">Blah</key>
<!-- child #3: newline / whitespace -->
<!-- child #4: --> <key -------/>
<!-- child #5: newline -->
</keys>

I think is the answer to an implied question: Where are the other three
children? (Parser says 5, I see 2...)

Brion

-----Original Message-----
From: Rob Outar [mailto:routar@ideorlando.org]
Sent: Thursday, December 12, 2002 4:54 PM
To: xerces-j-user@xml.apache.org
Subject: Question on Feature:
http://apache.org/xml/features/dom/include-ignorable-whitespace


The feature states the following:

The only way that the parser can determine if text is ignorable is by
reading the associated grammar and having a content model for the document.
When ignorable white space text nodes are included in the DOM tree, they
will be flagged as ignorable. The ignorable flag can be queried by calling
the TextImpl#isIgnorableWhitespace():boolean method. This feature is
relevant only when the grammar is DTD.

My question is what does the parser consider ingnorableWhitespace?  My
question is prompted by the following:

Consider:

<keys>
	<key name = "foo">Blah</key>
	<key -------/>
<keys>

The parser is telling me that keys has 5 children, it looks like to be that
keys has 2 children.

Let me know.

Thanks,

Rob



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

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


RE: Question on Feature: http://apache.org/xml/features/dom/include-ignorable-whitespace

Posted by Joseph Kesselman <ke...@us.ibm.com>.
On Friday, 12/13/2002 at 09:18 EST, "Rob Outar" <ro...@ideorlando.org> 
wrote:
> What has to be specified in the schema or DTD that makes clear what is
> irrelevant white space?

Make sure that the possible content of the element does *not* include 
#PCDATA.

______________________________________
Joe Kesselman  / IBM Research


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


RE: Question on Feature: http://apache.org/xml/features/dom/include-ignorable-whitespace

Posted by Rob Outar <ro...@ideorlando.org>.
What has to be specified in the schema or DTD that makes clear what is
irrelevant white space?

Thanks,

Rob


-----Original Message-----
From: Joseph Kesselman [mailto:keshlam@us.ibm.com]
Sent: Friday, December 13, 2002 8:44 AM
To: xerces-j-user@xml.apache.org
Subject: RE: Question on Feature:
http://apache.org/xml/features/dom/include-ignorable-whitespace


>Is there any way to get rid of those irrelevant children?

1) Validate against a DTD or Schema which makes clear that they are
irrelevant.
2) Write code that understands which are irrelevant and removes them.

Those are your only available choices. If you don't provide the
programmatic information that says they're irrelevant, the parser must
assume they could be meaningful.

This is standard XML processing rules.

______________________________________
Joe Kesselman  / IBM Research


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


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


RE: Question on Feature: http://apache.org/xml/features/dom/include-ignorable-whitespace

Posted by Joseph Kesselman <ke...@us.ibm.com>.
>Is there any way to get rid of those irrelevant children?

1) Validate against a DTD or Schema which makes clear that they are 
irrelevant.
2) Write code that understands which are irrelevant and removes them.

Those are your only available choices. If you don't provide the 
programmatic information that says they're irrelevant, the parser must 
assume they could be meaningful.

This is standard XML processing rules.

______________________________________
Joe Kesselman  / IBM Research


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


RE: Question on Feature: http://apache.org/xml/features/dom/include-ignorable-whitespace

Posted by Rob Outar <ro...@ideorlando.org>.
Is there any way to get rid of those irrelevant children?

Thanks,

Rob


-----Original Message-----
From: Swanson, Brion [mailto:Brion.Swanson@westgroup.com]
Sent: Thursday, December 12, 2002 6:08 PM
To: 'xerces-j-user@xml.apache.org'
Subject: RE: Question on Feature:
http://apache.org/xml/features/dom/include-ignorable-whitespace


Hi Rob,

Aside from the wonderful discussion of what is ignorable whitespace and what
is not that Sandy and Joe have provided, your five children are thus:

<keys>
<!-- child #1: newline / whitespace -->
<!-- child #2: --> <key name="foo">Blah</key>
<!-- child #3: newline / whitespace -->
<!-- child #4: --> <key -------/>
<!-- child #5: newline -->
</keys>

I think is the answer to an implied question: Where are the other three
children? (Parser says 5, I see 2...)

Brion

-----Original Message-----
From: Rob Outar [mailto:routar@ideorlando.org]
Sent: Thursday, December 12, 2002 4:54 PM
To: xerces-j-user@xml.apache.org
Subject: Question on Feature:
http://apache.org/xml/features/dom/include-ignorable-whitespace


The feature states the following:

The only way that the parser can determine if text is ignorable is by
reading the associated grammar and having a content model for the document.
When ignorable white space text nodes are included in the DOM tree, they
will be flagged as ignorable. The ignorable flag can be queried by calling
the TextImpl#isIgnorableWhitespace():boolean method. This feature is
relevant only when the grammar is DTD.

My question is what does the parser consider ingnorableWhitespace?  My
question is prompted by the following:

Consider:

<keys>
	<key name = "foo">Blah</key>
	<key -------/>
<keys>

The parser is telling me that keys has 5 children, it looks like to be that
keys has 2 children.

Let me know.

Thanks,

Rob



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

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


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