Skip to content

Commit

Permalink
DOM2DTM keep the white-space skipping logic (for now)
Browse files Browse the repository at this point in the history
... not needed for Nokogiri but its not clear what else it might affect
  • Loading branch information
kares committed Feb 12, 2017
1 parent 214145c commit 3648e36
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions ext/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMExt.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,18 @@ protected boolean nextNode()

// Scan logically contiguous text (siblings, plus "flattening"
// of entity reference boundaries).
Node n=next;
while(n!=null)
{
lastTextNode=n;
// Any Text node means DTM considers it all Text
if(TEXT_NODE == n.getNodeType()) nexttype = TEXT_NODE;
// Any non-whitespace in this sequence blocks whitespace
// suppression
suppressNode &= XMLCharacterRecognizer.isWhiteSpace(n.getNodeValue());

n=logicalNextDOMTextNode(n);
if (suppressNode) {
Node n = next;
while (n != null) {
lastTextNode=n;
// Any Text node means DTM considers it all Text
if (TEXT_NODE == n.getNodeType()) nexttype = TEXT_NODE;
// Any non-whitespace in this sequence blocks whitespace
// suppression
suppressNode &= XMLCharacterRecognizer.isWhiteSpace(n.getNodeValue());

n = logicalNextDOMTextNode(n);
}
}
}

Expand Down Expand Up @@ -571,12 +572,11 @@ else if(PROCESSING_INSTRUCTION_NODE==nexttype)
} // (if !suppressNode)

// Text postprocessing: Act on values stored above
// if(TEXT_NODE == nexttype || CDATA_SECTION_NODE == nexttype)
// {
// // %TBD% If nexttype was forced to TEXT, patch the DTM node
//
// //next=lastTextNode; // Advance the DOM cursor over contiguous text
// }
//if(TEXT_NODE == nexttype || CDATA_SECTION_NODE == nexttype)
//{
// %TBD% If nexttype was forced to TEXT, patch the DTM node
if (lastTextNode != null) next=lastTextNode; // Advance the DOM cursor over contiguous text
//}

// Remember where we left off.
m_pos=next;
Expand Down

0 comments on commit 3648e36

Please sign in to comment.