private String getValueSource(ElementImpl ownerElement) { if (this.valueSource != null) return this.valueSource; // DW: 4/16/2003 due to change in structuredDocument ... we need a // flatnode to // get at region values. For now I'll assume this is always the first // flatnode .. may need to make smarter later (e.g. to search for // the flatnode that this.valueRegion belongs to. if (this.valueRegion != null) return StructuredDocumentRegionUtil.getAttrValue(ownerElement.getStructuredDocumentRegion(), this.valueRegion); return new String(); }
/** */ public String getValueSource() { if (this.valueSource != null) return this.valueSource; // DW: 4/16/2003 due to change in structuredDocument ... we need a // flatnode to // get at region values. For now I'll assume this is always the first // flatnode .. may need to make smarter later (e.g. to search for // the flatnode that this.valueRegion belongs to. // DW: 4/30/2003 For some reason, this method is getting called a lot // Not sure if its a threading problem, or a fundamental error // elsewhere. // It needs more investigation, but in the use cases I've seen, // doesn't // seem to hurt to simply return null in those cases. I saw this null // case, // when tryint go format an XML file. if (this.ownerElement == null) return null; IStructuredDocumentRegion ownerRegion = this.ownerElement.getFirstStructuredDocumentRegion(); if (ownerRegion == null) return null; if (this.valueRegion != null) return StructuredDocumentRegionUtil.getAttrValue(ownerRegion, this.valueRegion); return new String(); }
publicId = StructuredDocumentRegionUtil.getAttrValue(flatNode, region); systemId = StructuredDocumentRegionUtil.getAttrValue(flatNode, region);