|
|
Re: ID Attribute Name [message #530990 is a reply to message #530928] |
Mon, 03 May 2010 09:33 |
John T.E. Timm Messages: 161 Registered: July 2009 |
Senior Member |
|
|
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:
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
[Updated on: Mon, 03 May 2010 10:00] Report message to a moderator
|
|
|
Re: ID Attribute Name [message #530997 is a reply to message #530990] |
Mon, 03 May 2010 09:37 |
Ed Merks Messages: 33136 Registered: July 2009 |
Senior Member |
|
|
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
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02445 seconds