Methods Summary |
---|
public java.lang.String | getChildrenSchemaDeterminedID(org.apache.xerces.xni.XMLAttributes attributes, int index)Not quite sure how this can be correctly implemented.
return null;
|
public java.lang.String | getDTDDeterminedID(org.apache.xerces.xni.XMLAttributes attributes, int index)Rerturns the DTD determine-ID
if (attributes.getType(index).equals("ID")) {
return attributes.getValue(index);
}
return null;
|
public java.lang.String | getSchemaDeterminedID(org.apache.xerces.xni.XMLAttributes attributes, int index)Returns the schema-determined-ID.
Augmentations augs = attributes.getAugmentations(index);
AttributePSVI attrPSVI = (AttributePSVI) augs
.getItem(Constants.ATTRIBUTE_PSVI);
if (attrPSVI != null) {
// An element or attribute information item is a schema-determined
// ID if and only if one of the following is true:]
// 1. It has a [member type definition] or [type definition] property
// whose value in turn has [name] equal to ID and [target namespace]
// equal to http://www.w3.org/2001/XMLSchema;
// 2. It has a [base type definition] whose value has that [name] and [target namespace];
// 3. It has a [base type definition] whose value has a [base type definition]
// whose value has that [name] and [target namespace], and so on following
// the [base type definition] property recursively;
XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
if (typeDef != null) {
typeDef = attrPSVI.getTypeDefinition();
}
//
if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
return attrPSVI.getSchemaNormalizedValue();
}
// 4 & 5 NA
}
return null;
|
public java.lang.String | getSchemeData()
return null;
|
public java.lang.String | getSchemeName()Returns the name of the ShortHand pointer
return fShortHandPointer;
|
private boolean | hasMatchingIdentifier(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs, int event)
String normalizedValue = null;
// The identifiers of an element are determined by the
// ShortHand Pointer as follows:
if (attributes != null) {
for (int i = 0; i < attributes.getLength(); i++) {
// 1. If an element information item has an attribute information item
// among its [attributes] that is a schema-determined ID, then it is
// identified by the value of that attribute information item's
// [schema normalized value] property;
normalizedValue = getSchemaDeterminedID(attributes, i);
if (normalizedValue != null) {
break;
}
// 2. If an element information item has an element information item among
// its [children] that is a schema-determined ID, then it is identified by
// the value of that element information item's [schema normalized value] property;
// ???
normalizedValue = getChildrenSchemaDeterminedID(attributes, i);
if (normalizedValue != null) {
break;
}
// 3. If an element information item has an attribute information item among
// its [attributes] that is a DTD-determined ID, then it is identified by the
// value of that attribute information item's [normalized value] property.
// An attribute information item is a DTD-determined ID if and only if it has
// a [type definition] property whose value is equal to ID.
normalizedValue = getDTDDeterminedID(attributes, i);
if (normalizedValue != null) {
break;
}
// 4. No externally determined ID's
}
}
if (normalizedValue != null
&& normalizedValue.equals(fShortHandPointer)) {
return true;
}
return false;
|
public boolean | isChildFragmentResolved()
return fIsFragmentResolved && (fMatchingChildCount > 0);
|
public boolean | isFragmentResolved()
return fIsFragmentResolved;
|
public void | parseXPointer(java.lang.String part)The XPointerProcessor takes care of this. Simply set the ShortHand Pointer here.
fShortHandPointer = part;
// reset fIsFragmentResolved
fIsFragmentResolved = false;
|
public boolean | resolveXPointer(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs, int event)
// reset fIsFragmentResolved
if (fMatchingChildCount == 0) {
fIsFragmentResolved = false;
}
// On startElement or emptyElement, if no matching elements or parent
// elements were found, check for a matching idenfitier.
if (event == XPointerPart.EVENT_ELEMENT_START) {
if (fMatchingChildCount == 0) {
fIsFragmentResolved = hasMatchingIdentifier(element, attributes, augs,
event);
}
if (fIsFragmentResolved) {
fMatchingChildCount++;
}
} else if (event == XPointerPart.EVENT_ELEMENT_EMPTY) {
if (fMatchingChildCount == 0) {
fIsFragmentResolved = hasMatchingIdentifier(element, attributes, augs,
event);
}
}
else {
// On endElement, decrease the matching child count if the child or
// its parent was resolved.
if (fIsFragmentResolved) {
fMatchingChildCount--;
}
}
return fIsFragmentResolved ;
|
public void | setSchemeData(java.lang.String schemeData)
// NA
|
public void | setSchemeName(java.lang.String schemeName)
fShortHandPointer = schemeName;
|