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 scarso luigi <sc...@libero.it> on 2002/12/09 10:36:41 UTC
Bug in *ContentModel.java ?
I have some troubles in following lines from
org/apache/xerces/impl/dtd/models/SimpleContentModel.java
in xercers-2_2_1
95 /**
96 * The element decl pool indices of the first (and optional second)
97 * child node. The operation code tells us whether the second child
98 * is used or not.
99 */
100 private QName fFirstChild = new QName();
101 /**
102 * The element decl pool indices of the first (and optional second)
103 * child node. The operation code tells us whether the second child
104 * is used or not.
105 */
106 private QName fSecondChild = new QName();
145 //
146 // ContentModelValidator methods
147 //
171 public int validate(QName[] children, int offset, int length) {
172 //
173 // According to the type of operation, we do the correct type of
174 // content check.
175 //
176 switch(fOperator)
177 {
178 case XMLContentSpec.CONTENTSPECNODE_LEAF :
179 // If there is not a child, then report an error at index 0
180 if (length == 0)
181 return 0;
182 // If the 0th child is not the right kind, report an error at 0
183 if (children[offset].rawname != fFirstChild.rawname) {
184 return 0;
185 }
282 } // validate
283 } // class SimpleContentModel
Is
children[offset].rawname != fFirstChild.rawname)
correct ?
Maybe
!(children[offset].rawname.equals(fFirstChild.rawname))
is better ?
Thanks in advance
luigi
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org