ID Attribute Name [message #530928] |
Sun, 02 May 2010 20:48  |
Eclipse User |
|
|
|
I have XML documents that use "ID" as the ID attribute name. I am currently using ExtendedMetaData. What is the best approach to enable automatic recording of extrinsic IDs in the Resource? From what I have read, XMLMap is not compatible with ExtendedMetaData and the two should not be used together.
Thanks,
JT
|
|
|
|
|
Re: ID Attribute Name [message #530997 is a reply to message #530990] |
Mon, 03 May 2010 05:37  |
Eclipse User |
|
|
|
JT,
If necessary (if the XML map option interacts badly; it wasn't designed
to be used with extended meta data) you can construct a specialized
instance of XMLHandler and set idAttribute directly.
John T.E. Timm wrote:
> Ed:
>
> Thanks for the reply. I don't want intrinsic IDs. After reviewing the
> source code, I see that in XMLHandler idAttribute is set to the value
> of xmlMap.getIDAttributeName() and in SAXXMLHandler, if an attribute
> exists with a name that is equal to idAttribute, then the extrinsic ID
> is set automatically. So I think what I want is something like:
>
> boolean useIDs() { return true; }
>
> XMLMap xmlMap = new XMLMapImpl();
> xmlMap.setIDAttributeName("ID");
> resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_ MAP, xmlMap);
>
> However, my concern is that I am already using ExtendedMetaData as an
> option on the same resource. I am wondering if it is a good idea to
> use both options simultaneously. From other posts, it seems that it is
> not recommended. Please advise.
>
> Thanks,
>
> JT
|
|
|
Powered by
FUDForum. Page generated in 0.04294 seconds