How to retrieve the xml encoding from the schema [message #72976] |
Wed, 05 September 2007 15:07  |
Eclipse User |
|
|
|
Originally posted by: nospam.nospam.com
Hi all,
I need to get the XML encoding from the loaded Schema, we set XSD_TRACK_LOCATION to true prior to parsing i.e.
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getLoadOptions().put(XSDResourceImpl.XSD_TRACK_L OCATION,
Boolean.TRUE);
// parse the doc..
XSDResourceImpl xsdResource = (XSDResourceImpl) resourceSet
.getResource(schemaURI,true);
XSDSchema x = xsdResource.getSchema();
However, the following always returns null
String encoding = x.getDocument().getXMLEncoding();
Does anyone know how to get the xml encoding from the schema ?
Many thanks in advance
Tony
|
|
|
Re: How to retrieve the xml encoding from the schema [message #73004 is a reply to message #72976] |
Wed, 05 September 2007 15:16   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Tony,
The encoding will be put into the
XSDResourceImpl.getDefaultSaveOptions() map via the XSD_ENCODING option
as the key.
TG wrote:
> Hi all,
>
> I need to get the XML encoding from the loaded Schema, we set
> XSD_TRACK_LOCATION to true prior to parsing i.e.
>
> ResourceSet resourceSet = new ResourceSetImpl();
>
> resourceSet.getLoadOptions().put(XSDResourceImpl.XSD_TRACK_L OCATION,
>
> Boolean.TRUE);
> // parse the doc..
> XSDResourceImpl xsdResource = (XSDResourceImpl) resourceSet
> .getResource(schemaURI,true);
>
> XSDSchema x = xsdResource.getSchema();
>
> However, the following always returns null
> String encoding = x.getDocument().getXMLEncoding();
>
> Does anyone know how to get the xml encoding from the schema ?
>
> Many thanks in advance
>
> Tony
|
|
|
Re: How to retrieve the xml encoding from the schema [message #73020 is a reply to message #73004] |
Wed, 05 September 2007 18:35  |
Eclipse User |
|
|
|
Originally posted by: nospam.ibm.com
Thanks for the quick response Ed.
Does the trick nicely
Ed Merks wrote:
> Tony,
>
> The encoding will be put into the
> XSDResourceImpl.getDefaultSaveOptions() map via the XSD_ENCODING option
> as the key.
>
>
> TG wrote:
>> Hi all,
>>
>> I need to get the XML encoding from the loaded Schema, we set
>> XSD_TRACK_LOCATION to true prior to parsing i.e.
>>
>> ResourceSet resourceSet = new ResourceSetImpl();
>>
>> resourceSet.getLoadOptions().put(XSDResourceImpl.XSD_TRACK_L OCATION,
>>
>> Boolean.TRUE);
>> // parse the doc..
>> XSDResourceImpl xsdResource = (XSDResourceImpl) resourceSet
>> .getResource(schemaURI,true);
>> XSDSchema x = xsdResource.getSchema();
>>
>> However, the following always returns null
>> String encoding = x.getDocument().getXMLEncoding();
>>
>> Does anyone know how to get the xml encoding from the schema ?
>>
>> Many thanks in advance
>>
>> Tony
|
|
|
Re: How to retrieve the xml encoding from the schema [message #602596 is a reply to message #72976] |
Wed, 05 September 2007 15:16  |
Eclipse User |
|
|
|
Tony,
The encoding will be put into the
XSDResourceImpl.getDefaultSaveOptions() map via the XSD_ENCODING option
as the key.
TG wrote:
> Hi all,
>
> I need to get the XML encoding from the loaded Schema, we set
> XSD_TRACK_LOCATION to true prior to parsing i.e.
>
> ResourceSet resourceSet = new ResourceSetImpl();
>
> resourceSet.getLoadOptions().put(XSDResourceImpl.XSD_TRACK_L OCATION,
>
> Boolean.TRUE);
> // parse the doc..
> XSDResourceImpl xsdResource = (XSDResourceImpl) resourceSet
> .getResource(schemaURI,true);
>
> XSDSchema x = xsdResource.getSchema();
>
> However, the following always returns null
> String encoding = x.getDocument().getXMLEncoding();
>
> Does anyone know how to get the xml encoding from the schema ?
>
> Many thanks in advance
>
> Tony
|
|
|
Re: How to retrieve the xml encoding from the schema [message #602604 is a reply to message #73004] |
Wed, 05 September 2007 18:35  |
Eclipse User |
|
|
|
Thanks for the quick response Ed.
Does the trick nicely
Ed Merks wrote:
> Tony,
>
> The encoding will be put into the
> XSDResourceImpl.getDefaultSaveOptions() map via the XSD_ENCODING option
> as the key.
>
>
> TG wrote:
>> Hi all,
>>
>> I need to get the XML encoding from the loaded Schema, we set
>> XSD_TRACK_LOCATION to true prior to parsing i.e.
>>
>> ResourceSet resourceSet = new ResourceSetImpl();
>>
>> resourceSet.getLoadOptions().put(XSDResourceImpl.XSD_TRACK_L OCATION,
>>
>> Boolean.TRUE);
>> // parse the doc..
>> XSDResourceImpl xsdResource = (XSDResourceImpl) resourceSet
>> .getResource(schemaURI,true);
>> XSDSchema x = xsdResource.getSchema();
>>
>> However, the following always returns null
>> String encoding = x.getDocument().getXMLEncoding();
>>
>> Does anyone know how to get the xml encoding from the schema ?
>>
>> Many thanks in advance
>>
>> Tony
|
|
|
Powered by
FUDForum. Page generated in 0.03887 seconds