Home » Archived » XML Schema Definition (XSD) » Retrieving documentation from an <xsd:pattern> within a schema
Retrieving documentation from an <xsd:pattern> within a schema [message #55247] |
Thu, 25 November 2004 10:42  |
Eclipse User |
|
|
|
Originally posted by: none.nonet.com
Hi there,
I'm having trouble retrieving the text from a documentation element
contained within an annotation within an <xs:pattern> element. Through the
API i can successfully get the text from annotations/documentation within
other parts, such as element declarations or type definitions, just not when
the annotation is within the pattern. Here's an example
<xs:simpleType name="ISBN">
<xs:annotation>
<xs:documentation>The ISBN is a unique code identifying the
book</xs:documentation> ///I can get this one
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]{3}(-[0-9]{6})?">
<xs:annotation>
<xs:documentation>A string of the form
aaa-xxxxxx</xs:documentation> ///I can't get this one
</xs:annotation>
</xs:pattern>
</xs:restriction>
</xs:simpleType>
I'm wondering if this is a known bug, or if i'm missing something obvious.
If it is a bug, any ideas how to go about submitting it?
Thanks very much for your help,
Ray
|
|
|
Re: Retrieving documentation from an <xsd:pattern> within a schema [message #55275 is a reply to message #55247] |
Thu, 25 November 2004 11:54   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Ray,
Pattern and enumeration facets are a little tricky because although they
can repeat in the syntax, in the abstract model there can only be one
such facet. So a single facet is synthesized from the repeated facets
and that synthesized facet has a getAnnotations reference that's
populated from all the contained annotations of all the repeats. So if
you are looking at the synthesized facet, you should look at the
getAnnotations.
Ray wrote:
>Hi there,
>
>I'm having trouble retrieving the text from a documentation element
>contained within an annotation within an <xs:pattern> element. Through the
>API i can successfully get the text from annotations/documentation within
>other parts, such as element declarations or type definitions, just not when
>the annotation is within the pattern. Here's an example
>
><xs:simpleType name="ISBN">
> <xs:annotation>
> <xs:documentation>The ISBN is a unique code identifying the
>book</xs:documentation> ///I can get this one
> </xs:annotation>
> <xs:restriction base="xs:string">
> <xs:pattern value="[a-z]{3}(-[0-9]{6})?">
> <xs:annotation>
> <xs:documentation>A string of the form
>aaa-xxxxxx</xs:documentation> ///I can't get this one
> </xs:annotation>
> </xs:pattern>
> </xs:restriction>
></xs:simpleType>
>
>I'm wondering if this is a known bug, or if i'm missing something obvious.
>If it is a bug, any ideas how to go about submitting it?
>
>Thanks very much for your help,
>
>Ray
>
>
>
>
|
|
|
Re: Retrieving documentation from an <xsd:pattern> within a schema [message #55329 is a reply to message #55275] |
Fri, 26 November 2004 05:36   |
Eclipse User |
|
|
|
Originally posted by: none.nonet.com
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:co52oe$vp$1@www.eclipse.org...
> Ray,
>
> Pattern and enumeration facets are a little tricky because although they
> can repeat in the syntax, in the abstract model there can only be one such
> facet. So a single facet is synthesized from the repeated facets and that
> synthesized facet has a getAnnotations reference that's populated from all
> the contained annotations of all the repeats. So if you are looking at
> the synthesized facet, you should look at the getAnnotations.
>
>
Hey Ed,
Thanks again for your quick response and help. Here's the code I'm
using......
XSDSimpleTypeDefinition a_simpleType = (XSDSimpleTypeDefinition) a_typeDef;
//get the simple type def
EList temp = a_simpleType.getSyntheticFacets(); //get the
synthetic facets
for (int i = 0 ; i < temp.size() ; i++) //for each facet
{
XSDFacet facet = (XSDFacet) temp.get(i); //can look in
here with debugger and see xs:pattern no prob.
XSDAnnotation annos = facet.getAnnotation(); //there is no
getAnnotations function within api for a facet.
//this returns null..........
//doesn't reach here - throws, but this is how i would get the 1st
documentation element
annos.getUserInformation()
Element documentationElement =
(Element)(annos.getUserInformation().get(0));
String documentation;
if(documentationElement.hasChildNodes())
{
documentation =
documentationElement.getChildNodes().item(0).getNodeValue();
}
}
However, within the Eclipse debugger, i can see an 'annotations' member of
the facet, which on further inspection does have user information, which
seems to have no content. Any thoughts?
Just as a recap, here's that simple type def from the schema again.....
<xs:simpleType name="ISBN">
<xs:annotation>
<xs:documentation>The ISBN is a unique code identifying the
book</xs:documentation> ///I can get this one
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]{3}(-[0-9]{6})?">
<xs:annotation>
<xs:documentation>A string of the form
aaa-xxxxxx</xs:documentation> ///I can't get this one
</xs:annotation>
</xs:pattern>
</xs:restriction>
</xs:simpleType>
Ray
|
|
|
Re: Retrieving documentation from an <xsd:pattern> within a schema [message #55356 is a reply to message #55329] |
Fri, 26 November 2004 06:47   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------000709090403020206040102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Ray,
An XSDPatternFacet and an XSDEnumerationFacet are both
XSDRepeatableFacets and therefore have this method available:
public interface XSDRepeatableFacet extends XSDConstrainingFacet
{
/**
* Returns the value of the '<em><b>Annotations</b></em>'
reference list.
* The list contents are of type {@link
org.eclipse.xsd.XSDAnnotation}.
* <!-- begin-user-doc -->
* <p>
* This represents the
* enumeration <a
href="http://www.w3.org/TR/xmlschema-2/#enumeration-annotation">annotation</a>,
or
* pattern <a
href="http://www.w3.org/TR/xmlschema-2/#pattern-annotation">annotation</a>
* infoset property.
* It is computed from the concrete {@link #getAnnotation()
annotation content} and should typically not be modified directly.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Annotations</em>' reference list.
* @see org.eclipse.xsd.XSDPackage#getXSDRepeatableFacet_Annotations ()
* @model type="org.eclipse.xsd.XSDAnnotation" resolveProxies="false"
* @generated
*/
EList getAnnotations();
}
Ray wrote:
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:co52oe$vp$1@www.eclipse.org...
>
>
>>Ray,
>>
>>Pattern and enumeration facets are a little tricky because although they
>>can repeat in the syntax, in the abstract model there can only be one such
>>facet. So a single facet is synthesized from the repeated facets and that
>>synthesized facet has a getAnnotations reference that's populated from all
>>the contained annotations of all the repeats. So if you are looking at
>>the synthesized facet, you should look at the getAnnotations.
>>
>>
>>
>>
>
>Hey Ed,
>
>Thanks again for your quick response and help. Here's the code I'm
>using......
>
>XSDSimpleTypeDefinition a_simpleType = (XSDSimpleTypeDefinition) a_typeDef;
>//get the simple type def
>
>EList temp = a_simpleType.getSyntheticFacets(); //get the
>synthetic facets
>
>for (int i = 0 ; i < temp.size() ; i++) //for each facet
>{
> XSDFacet facet = (XSDFacet) temp.get(i); //can look in
>here with debugger and see xs:pattern no prob.
>
> XSDAnnotation annos = facet.getAnnotation(); //there is no
>getAnnotations function within api for a facet.
>
> //this returns null..........
>
> //doesn't reach here - throws, but this is how i would get the 1st
>documentation element
>
> annos.getUserInformation()
> Element documentationElement =
>(Element)(annos.getUserInformation().get(0));
> String documentation;
> if(documentationElement.hasChildNodes())
> {
> documentation =
> documentationElement.getChildNodes().item(0).getNodeValue();
> }
> }
>
>However, within the Eclipse debugger, i can see an 'annotations' member of
>the facet, which on further inspection does have user information, which
>seems to have no content. Any thoughts?
>
>Just as a recap, here's that simple type def from the schema again.....
><xs:simpleType name="ISBN">
> <xs:annotation>
> <xs:documentation>The ISBN is a unique code identifying the
>book</xs:documentation> ///I can get this one
> </xs:annotation>
> <xs:restriction base="xs:string">
> <xs:pattern value="[a-z]{3}(-[0-9]{6})?">
> <xs:annotation>
> <xs:documentation>A string of the form
>aaa-xxxxxx</xs:documentation> ///I can't get this one
> </xs:annotation>
> </xs:pattern>
> </xs:restriction>
></xs:simpleType>
>
>
>Ray
>
>
>
>
>
--------------000709090403020206040102
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ray,<br>
<br>
An XSDPatternFacet and an XSDEnumerationFacet are both
XSDRepeatableFacets and therefore have this method available:<br>
<blockquote><small>public interface XSDRepeatableFacet extends
XSDConstrainingFacet</small><br>
<small>{</small><br>
<small> /**</small><br>
<small> * Returns the value of the
'<em><b>Annotations</b&am p;gt;</em>' reference list.</small><br>
<small> * The list contents are of type {@link
org.eclipse.xsd.XSDAnnotation}.</small><br>
<small> * <!-- begin-user-doc --></small><br>
<small> * <p></small><br>
<small> * This represents the</small><br>
<small> * enumeration <a
href=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xmlschema-2/#enumeration-annotation">"http://www.w3.org/TR/xmlschema-2/#enumeration-annotation"</a>>annotation</a>,
or</small><br>
<small> * pattern <a
href=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xmlschema-2/#pattern-annotation">"http://www.w3.org/TR/xmlschema-2/#pattern-annotation"</a>>annotation</a></small><br>
<small> * infoset property.</small><br>
<small> * It is computed from the concrete {@link #getAnnotation()
annotation content} and should typically not be modified directly.</small><br>
<small> * </p></small><br>
<small> * <!-- end-user-doc --></small><br>
<small> * @return the value of the
'<em>Annotations</em>' reference list.</small><br>
<small> * @see
org.eclipse.xsd.XSDPackage#getXSDRepeatableFacet_Annotations () </small><br>
<small> * @model type="org.eclipse.xsd.XSDAnnotation"
resolveProxies="false"</small><br>
<small> * @generated</small><br>
<small> */</small><br>
<small> EList getAnnotations();</small><br>
<br>
<small>}</small><br>
</blockquote>
<br>
Ray wrote:
<blockquote cite="midco7106$o49$1@www.eclipse.org" type="cite">
<pre wrap="">"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com"><merks@ca.ibm.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:co52oe$vp$1@www.eclipse.org">news:co52oe$vp$1@www.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Ray,
Pattern and enumeration facets are a little tricky because although they
can repeat in the syntax, in the abstract model there can only be one such
facet. So a single facet is synthesized from the repeated facets and that
synthesized facet has a getAnnotations reference that's populated from all
the contained annotations of all the repeats. So if you are looking at
the synthesized facet, you should look at the getAnnotations.
</pre>
</blockquote>
<pre wrap=""><!---->
Hey Ed,
Thanks again for your quick response and help. Here's the code I'm
using......
XSDSimpleTypeDefinition a_simpleType = (XSDSimpleTypeDefinition) a_typeDef;
//get the simple type def
EList temp = a_simpleType.getSyntheticFacets(); //get the
synthetic facets
for (int i = 0 ; i < temp.size() ; i++) //for each facet
{
XSDFacet facet = (XSDFacet) temp.get(i); //can look in
here with debugger and see xs:pattern no prob.
XSDAnnotation annos = facet.getAnnotation(); //there is no
getAnnotations function within api for a facet.
//this returns null..........
//doesn't reach here - throws, but this is how i would get the 1st
documentation element
annos.getUserInformation()
Element documentationElement =
(Element)(annos.getUserInformation().get(0));
String documentation;
if(documentationElement.hasChildNodes())
{
documentation =
documentationElement.getChildNodes().item(0).getNodeValue();
}
}
However, within the Eclipse debugger, i can see an 'annotations' member of
the facet, which on further inspection does have user information, which
seems to have no content. Any thoughts?
Just as a recap, here's that simple type def from the schema again.....
<xs:simpleType name="ISBN">
<xs:annotation>
<xs:documentation>The ISBN is a unique code identifying the
book</xs:documentation> ///I can get this one
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]{3}(-[0-9]{6})?">
<xs:annotation>
<xs:documentation>A string of the form
aaa-xxxxxx</xs:documentation> ///I can't get this one
</xs:annotation>
</xs:pattern>
</xs:restriction>
</xs:simpleType>
Ray
</pre>
</blockquote>
<br>
</body>
</html>
--------------000709090403020206040102--
|
|
| |
Re: Retrieving documentation from an <xsd:pattern> within a schema [message #592712 is a reply to message #55247] |
Thu, 25 November 2004 11:54  |
Eclipse User |
|
|
|
Ray,
Pattern and enumeration facets are a little tricky because although they
can repeat in the syntax, in the abstract model there can only be one
such facet. So a single facet is synthesized from the repeated facets
and that synthesized facet has a getAnnotations reference that's
populated from all the contained annotations of all the repeats. So if
you are looking at the synthesized facet, you should look at the
getAnnotations.
Ray wrote:
>Hi there,
>
>I'm having trouble retrieving the text from a documentation element
>contained within an annotation within an <xs:pattern> element. Through the
>API i can successfully get the text from annotations/documentation within
>other parts, such as element declarations or type definitions, just not when
>the annotation is within the pattern. Here's an example
>
><xs:simpleType name="ISBN">
> <xs:annotation>
> <xs:documentation>The ISBN is a unique code identifying the
>book</xs:documentation> ///I can get this one
> </xs:annotation>
> <xs:restriction base="xs:string">
> <xs:pattern value="[a-z]{3}(-[0-9]{6})?">
> <xs:annotation>
> <xs:documentation>A string of the form
>aaa-xxxxxx</xs:documentation> ///I can't get this one
> </xs:annotation>
> </xs:pattern>
> </xs:restriction>
></xs:simpleType>
>
>I'm wondering if this is a known bug, or if i'm missing something obvious.
>If it is a bug, any ideas how to go about submitting it?
>
>Thanks very much for your help,
>
>Ray
>
>
>
>
|
|
|
Re: Retrieving documentation from an <xsd:pattern> within a schema [message #592746 is a reply to message #55275] |
Fri, 26 November 2004 05:36  |
Eclipse User |
|
|
|
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:co52oe$vp$1@www.eclipse.org...
> Ray,
>
> Pattern and enumeration facets are a little tricky because although they
> can repeat in the syntax, in the abstract model there can only be one such
> facet. So a single facet is synthesized from the repeated facets and that
> synthesized facet has a getAnnotations reference that's populated from all
> the contained annotations of all the repeats. So if you are looking at
> the synthesized facet, you should look at the getAnnotations.
>
>
Hey Ed,
Thanks again for your quick response and help. Here's the code I'm
using......
XSDSimpleTypeDefinition a_simpleType = (XSDSimpleTypeDefinition) a_typeDef;
//get the simple type def
EList temp = a_simpleType.getSyntheticFacets(); //get the
synthetic facets
for (int i = 0 ; i < temp.size() ; i++) //for each facet
{
XSDFacet facet = (XSDFacet) temp.get(i); //can look in
here with debugger and see xs:pattern no prob.
XSDAnnotation annos = facet.getAnnotation(); //there is no
getAnnotations function within api for a facet.
//this returns null..........
//doesn't reach here - throws, but this is how i would get the 1st
documentation element
annos.getUserInformation()
Element documentationElement =
(Element)(annos.getUserInformation().get(0));
String documentation;
if(documentationElement.hasChildNodes())
{
documentation =
documentationElement.getChildNodes().item(0).getNodeValue();
}
}
However, within the Eclipse debugger, i can see an 'annotations' member of
the facet, which on further inspection does have user information, which
seems to have no content. Any thoughts?
Just as a recap, here's that simple type def from the schema again.....
<xs:simpleType name="ISBN">
<xs:annotation>
<xs:documentation>The ISBN is a unique code identifying the
book</xs:documentation> ///I can get this one
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]{3}(-[0-9]{6})?">
<xs:annotation>
<xs:documentation>A string of the form
aaa-xxxxxx</xs:documentation> ///I can't get this one
</xs:annotation>
</xs:pattern>
</xs:restriction>
</xs:simpleType>
Ray
|
|
|
Re: Retrieving documentation from an <xsd:pattern> within a schema [message #592757 is a reply to message #55329] |
Fri, 26 November 2004 06:47  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------000709090403020206040102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Ray,
An XSDPatternFacet and an XSDEnumerationFacet are both
XSDRepeatableFacets and therefore have this method available:
public interface XSDRepeatableFacet extends XSDConstrainingFacet
{
/**
* Returns the value of the '<em><b>Annotations</b></em>'
reference list.
* The list contents are of type {@link
org.eclipse.xsd.XSDAnnotation}.
* <!-- begin-user-doc -->
* <p>
* This represents the
* enumeration <a
href="http://www.w3.org/TR/xmlschema-2/#enumeration-annotation">annotation</a>,
or
* pattern <a
href="http://www.w3.org/TR/xmlschema-2/#pattern-annotation">annotation</a>
* infoset property.
* It is computed from the concrete {@link #getAnnotation()
annotation content} and should typically not be modified directly.
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Annotations</em>' reference list.
* @see org.eclipse.xsd.XSDPackage#getXSDRepeatableFacet_Annotations ()
* @model type="org.eclipse.xsd.XSDAnnotation" resolveProxies="false"
* @generated
*/
EList getAnnotations();
}
Ray wrote:
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:co52oe$vp$1@www.eclipse.org...
>
>
>>Ray,
>>
>>Pattern and enumeration facets are a little tricky because although they
>>can repeat in the syntax, in the abstract model there can only be one such
>>facet. So a single facet is synthesized from the repeated facets and that
>>synthesized facet has a getAnnotations reference that's populated from all
>>the contained annotations of all the repeats. So if you are looking at
>>the synthesized facet, you should look at the getAnnotations.
>>
>>
>>
>>
>
>Hey Ed,
>
>Thanks again for your quick response and help. Here's the code I'm
>using......
>
>XSDSimpleTypeDefinition a_simpleType = (XSDSimpleTypeDefinition) a_typeDef;
>//get the simple type def
>
>EList temp = a_simpleType.getSyntheticFacets(); //get the
>synthetic facets
>
>for (int i = 0 ; i < temp.size() ; i++) //for each facet
>{
> XSDFacet facet = (XSDFacet) temp.get(i); //can look in
>here with debugger and see xs:pattern no prob.
>
> XSDAnnotation annos = facet.getAnnotation(); //there is no
>getAnnotations function within api for a facet.
>
> //this returns null..........
>
> //doesn't reach here - throws, but this is how i would get the 1st
>documentation element
>
> annos.getUserInformation()
> Element documentationElement =
>(Element)(annos.getUserInformation().get(0));
> String documentation;
> if(documentationElement.hasChildNodes())
> {
> documentation =
> documentationElement.getChildNodes().item(0).getNodeValue();
> }
> }
>
>However, within the Eclipse debugger, i can see an 'annotations' member of
>the facet, which on further inspection does have user information, which
>seems to have no content. Any thoughts?
>
>Just as a recap, here's that simple type def from the schema again.....
><xs:simpleType name="ISBN">
> <xs:annotation>
> <xs:documentation>The ISBN is a unique code identifying the
>book</xs:documentation> ///I can get this one
> </xs:annotation>
> <xs:restriction base="xs:string">
> <xs:pattern value="[a-z]{3}(-[0-9]{6})?">
> <xs:annotation>
> <xs:documentation>A string of the form
>aaa-xxxxxx</xs:documentation> ///I can't get this one
> </xs:annotation>
> </xs:pattern>
> </xs:restriction>
></xs:simpleType>
>
>
>Ray
>
>
>
>
>
--------------000709090403020206040102
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ray,<br>
<br>
An XSDPatternFacet and an XSDEnumerationFacet are both
XSDRepeatableFacets and therefore have this method available:<br>
<blockquote><small>public interface XSDRepeatableFacet extends
XSDConstrainingFacet</small><br>
<small>{</small><br>
<small> /**</small><br>
<small> * Returns the value of the
'<em><b>Annotations</b&am p;gt;</em>' reference list.</small><br>
<small> * The list contents are of type {@link
org.eclipse.xsd.XSDAnnotation}.</small><br>
<small> * <!-- begin-user-doc --></small><br>
<small> * <p></small><br>
<small> * This represents the</small><br>
<small> * enumeration <a
href=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xmlschema-2/#enumeration-annotation">"http://www.w3.org/TR/xmlschema-2/#enumeration-annotation"</a>>annotation</a>,
or</small><br>
<small> * pattern <a
href=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xmlschema-2/#pattern-annotation">"http://www.w3.org/TR/xmlschema-2/#pattern-annotation"</a>>annotation</a></small><br>
<small> * infoset property.</small><br>
<small> * It is computed from the concrete {@link #getAnnotation()
annotation content} and should typically not be modified directly.</small><br>
<small> * </p></small><br>
<small> * <!-- end-user-doc --></small><br>
<small> * @return the value of the
'<em>Annotations</em>' reference list.</small><br>
<small> * @see
org.eclipse.xsd.XSDPackage#getXSDRepeatableFacet_Annotations () </small><br>
<small> * @model type="org.eclipse.xsd.XSDAnnotation"
resolveProxies="false"</small><br>
<small> * @generated</small><br>
<small> */</small><br>
<small> EList getAnnotations();</small><br>
<br>
<small>}</small><br>
</blockquote>
<br>
Ray wrote:
<blockquote cite="midco7106$o49$1@www.eclipse.org" type="cite">
<pre wrap="">"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com"><merks@ca.ibm.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:co52oe$vp$1@www.eclipse.org">news:co52oe$vp$1@www.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Ray,
Pattern and enumeration facets are a little tricky because although they
can repeat in the syntax, in the abstract model there can only be one such
facet. So a single facet is synthesized from the repeated facets and that
synthesized facet has a getAnnotations reference that's populated from all
the contained annotations of all the repeats. So if you are looking at
the synthesized facet, you should look at the getAnnotations.
</pre>
</blockquote>
<pre wrap=""><!---->
Hey Ed,
Thanks again for your quick response and help. Here's the code I'm
using......
XSDSimpleTypeDefinition a_simpleType = (XSDSimpleTypeDefinition) a_typeDef;
//get the simple type def
EList temp = a_simpleType.getSyntheticFacets(); //get the
synthetic facets
for (int i = 0 ; i < temp.size() ; i++) //for each facet
{
XSDFacet facet = (XSDFacet) temp.get(i); //can look in
here with debugger and see xs:pattern no prob.
XSDAnnotation annos = facet.getAnnotation(); //there is no
getAnnotations function within api for a facet.
//this returns null..........
//doesn't reach here - throws, but this is how i would get the 1st
documentation element
annos.getUserInformation()
Element documentationElement =
(Element)(annos.getUserInformation().get(0));
String documentation;
if(documentationElement.hasChildNodes())
{
documentation =
documentationElement.getChildNodes().item(0).getNodeValue();
}
}
However, within the Eclipse debugger, i can see an 'annotations' member of
the facet, which on further inspection does have user information, which
seems to have no content. Any thoughts?
Just as a recap, here's that simple type def from the schema again.....
<xs:simpleType name="ISBN">
<xs:annotation>
<xs:documentation>The ISBN is a unique code identifying the
book</xs:documentation> ///I can get this one
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]{3}(-[0-9]{6})?">
<xs:annotation>
<xs:documentation>A string of the form
aaa-xxxxxx</xs:documentation> ///I can't get this one
</xs:annotation>
</xs:pattern>
</xs:restriction>
</xs:simpleType>
Ray
</pre>
</blockquote>
<br>
</body>
</html>
--------------000709090403020206040102--
|
|
| |
Goto Forum:
Current Time: Thu May 29 05:08:51 EDT 2025
Powered by FUDForum. Page generated in 0.03188 seconds
|