Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Problems getting appinfo and documentation from included schemas
Problems getting appinfo and documentation from included schemas [message #58565] Tue, 15 March 2005 15:20 Go to next message
Steve Speicher is currently offline Steve Speicher
Messages: 85
Registered: July 2009
Member

This is a multi-part message in MIME format.
--------------060804010008090006050605
Content-Type: multipart/alternative;
boundary="------------040600070900080902020800"


--------------040600070900080902020800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm attempting to load a schema that includes another schema. In the
process, I'm attempting to access the declared elements in the included
schema...namely the appinfo and documentation. I can read it fine for
the top-level schema.

Here's a sample schemas:

*toplevel.xsd*
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:contact="http://www.ibm.com/contact"
xmlns:cntadv="http://www.ibm.com/contact/advanced"
targetNamespace="http://www.ibm.com/contact"
elementFormDefault="qualified">

<include schemaLocation="Contact_include.xsd"/>

<element name="topcontactname" type="string">
<annotation>
<appinfo>
AppInfo for element "topcontactname".
</appinfo>
<documentation>
Docs for element "topcontactname".
</documentation>
</annotation>
</element>

</schema>

*Contact_include.xsd*
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">

<element name="contactname" type="string">
<annotation>
<appinfo>
AppInfo for element "contactname".
</appinfo>
<documentation>
Docs for element "contactname".
</documentation>
</annotation>
</element>

</schema>

I can successfully get the Annotations in toplevel.xsd but not
Contact_include.xsd. I've attached a sample plugin that adds a context
menu for *.xsd called 'Parse XSD with Include and Annotation'. It will
present an informational dialog with information received interrogating
the XSD api.

Is there something else I need to do? I'm running with the latest XSD code.

Thanks in advance,
Steve

--------------040600070900080902020800
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">
I'm attempting to load a schema that includes another schema.&nbsp; In the
process, I'm attempting to access the declared elements in the included
schema...namely the appinfo and documentation.&nbsp; I can read it fine for
the top-level schema.<br>
<br>
Here's a sample schemas:<br>
<blockquote><tt><b>toplevel.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E" href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> <br>
&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;<br>
<br>
&nbsp; &lt;element name="topcontactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
<br>
<b>Contact_include.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;element name="contactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
</tt></blockquote>
I can successfully get the Annotations in toplevel.xsd but not
Contact_include.xsd.&nbsp; I've attached a sample plugin that adds a context
menu for *.xsd called 'Parse XSD with Include and Annotation'.&nbsp; It will
present an informational dialog with information received interrogating
the XSD api.<br>
<br>
Is there something else I need to do?&nbsp; I'm running with the latest XSD
code.<br>
<br>
Thanks in advance,<br>
Steve<br>
</body>
</html>

--------------040600070900080902020800--

--------------060804010008090006050605
Content-Type: application/zip;
name="xsd.includeannotation.sample.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="xsd.includeannotation.sample.zip"

UEsDBBQACAAIAARObzIAAAAAAAAAAAAAAAArAAAAY29tLmlibS5ldGVjaC54 c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C54c2Quc2FtcGxlLmluY2x1ZGUvc3Jj L2NvbS9pYm0v
ZXRlY2gveHNkL3NhbXBsZS9pbmNsdWRlL3BvcHVwL2FjdGlvbnMvUGFyc2VY U0R3aXRoSW5j
bHVkZS5qYXZhUEsFBgAAAAAGAAYAiAIAAFMNAAAAAA==
--------------060804010008090006050605--
Re: Problems getting appinfo and documentation from included schemas [message #58600 is a reply to message #58565] Tue, 15 March 2005 17:31 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------050609050705010500070607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Steve,

You're right. For cloned/incorporated schemas, the annotation
information is not all available. I think *these *lines need to be
added in XSDAnnotationImpl:

public XSDConcreteComponent cloneConcreteComponent(boolean deep,
boolean shareDOM)
{
XSDAnnotationImpl clonedAnnotation =
(XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();
clonedAnnotation.isReconciling = true;

if (shareDOM)
{
Element element = getElement();
if (element != null)
{
clonedAnnotation.setElement(element);
}

*
clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation());*
*
clonedAnnotation.getUserInformation().addAll(getUserInformat ion());*
* clonedAnnotation.getAttributes().addAll(getAttributes());*
}

clonedAnnotation.isReconciling = shareDOM;
return clonedAnnotation;
}

Please open a bugzilla and I'll commit this change. (Thanks for the
nice testcase!)



Steve Speicher wrote:

> I'm attempting to load a schema that includes another schema. In the
> process, I'm attempting to access the declared elements in the
> included schema...namely the appinfo and documentation. I can read it
> fine for the top-level schema.
>
> Here's a sample schemas:
>
> *toplevel.xsd*
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:contact="http://www.ibm.com/contact"
> xmlns:cntadv="http://www.ibm.com/contact/advanced"
> targetNamespace="http://www.ibm.com/contact"
> elementFormDefault="qualified">
>
> <include schemaLocation="Contact_include.xsd"/>
>
> <element name="topcontactname" type="string">
> <annotation>
> <appinfo>
> AppInfo for element "topcontactname".
> </appinfo>
> <documentation>
> Docs for element "topcontactname".
> </documentation>
> </annotation>
> </element>
>
> </schema>
>
> *Contact_include.xsd*
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
>
> <element name="contactname" type="string">
> <annotation>
> <appinfo>
> AppInfo for element "contactname".
> </appinfo>
> <documentation>
> Docs for element "contactname".
> </documentation>
> </annotation>
> </element>
>
> </schema>
>
> I can successfully get the Annotations in toplevel.xsd but not
> Contact_include.xsd. I've attached a sample plugin that adds a
> context menu for *.xsd called 'Parse XSD with Include and
> Annotation'. It will present an informational dialog with information
> received interrogating the XSD api.
>
> Is there something else I need to do? I'm running with the latest XSD
> code.
>
> Thanks in advance,
> Steve



--------------050609050705010500070607
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">
</head>
<body bgcolor="#ffffff" text="#000000">
Steve,<br>
<br>
You're right.&nbsp; For cloned/incorporated schemas, the annotation
information is not all available.&nbsp; I think <b>these </b>lines need to
be added in XSDAnnotationImpl:<br>
<blockquote><small>&nbsp; public XSDConcreteComponent
cloneConcreteComponent(boolean deep, boolean shareDOM)</small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; XSDAnnotationImpl clonedAnnotation =
(XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();</small ><br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = true;</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; if (shareDOM)</small><br>
<small>&nbsp;&nbsp;&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element element = getElement();</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (element != null)</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; clonedAnnotation.setElement(element);</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getUserInformation().addAll(getUserInformat ion()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getAttributes().addAll(getAttributes());</b ></small><br>
<small>&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = shareDOM;</small><br>
<small>&nbsp;&nbsp;&nbsp; return clonedAnnotation;</small><br>
<small>&nbsp; }</small><br>
</blockquote>
Please open a bugzilla and I'll commit this change.&nbsp; (Thanks for the
nice testcase!)<br>
<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd16ufu$ed3$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
I'm attempting to load a schema that includes another schema.&nbsp; In the
process, I'm attempting to access the declared elements in the included
schema...namely the appinfo and documentation.&nbsp; I can read it fine for
the top-level schema.<br>
<br>
Here's a sample schemas:<br>
<blockquote><tt><b>toplevel.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> <br>
&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;<br>
<br>
&nbsp; &lt;element name="topcontactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
<br>
<b>Contact_include.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;element name="contactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
</tt></blockquote>
I can successfully get the Annotations in toplevel.xsd but not
Contact_include.xsd.&nbsp; I've attached a sample plugin that adds a context
menu for *.xsd called 'Parse XSD with Include and Annotation'.&nbsp; It will
present an informational dialog with information received interrogating
the XSD api.<br>
<br>
Is there something else I need to do?&nbsp; I'm running with the latest XSD
code.<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</body>
</html>

--------------050609050705010500070607--
Re: Problems getting appinfo and documentation from included schemas [message #58626 is a reply to message #58600] Tue, 15 March 2005 19:03 Go to previous message
Steve Speicher is currently offline Steve Speicher
Messages: 85
Registered: July 2009
Member

This is a multi-part message in MIME format.
--------------040007030008060805040707
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ed,

Bug #88092 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=88092> has
been created for this.

Thanks for the quick reply and patch. I did make the code change and
works like a charm (not that I had any doubts ;-)

Steve

Ed Merks wrote:

> Steve,
>
> You're right. For cloned/incorporated schemas, the annotation
> information is not all available. I think *these *lines need to be
> added in XSDAnnotationImpl:
>
> public XSDConcreteComponent cloneConcreteComponent(boolean deep,
> boolean shareDOM)
> {
> XSDAnnotationImpl clonedAnnotation =
> (XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();
> clonedAnnotation.isReconciling = true;
>
> if (shareDOM)
> {
> Element element = getElement();
> if (element != null)
> {
> clonedAnnotation.setElement(element);
> }
>
> *
> clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation());*
> *
> clonedAnnotation.getUserInformation().addAll(getUserInformat ion());*
> * clonedAnnotation.getAttributes().addAll(getAttributes());*
> }
>
> clonedAnnotation.isReconciling = shareDOM;
> return clonedAnnotation;
> }
>
> Please open a bugzilla and I'll commit this change. (Thanks for the
> nice testcase!)
>
>
>
> Steve Speicher wrote:
>
>> I'm attempting to load a schema that includes another schema. In the
>> process, I'm attempting to access the declared elements in the
>> included schema...namely the appinfo and documentation. I can read
>> it fine for the top-level schema.
>>
>> Here's a sample schemas:
>>
>> *toplevel.xsd*
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> xmlns:contact="http://www.ibm.com/contact"
>> xmlns:cntadv="http://www.ibm.com/contact/advanced"
>> targetNamespace="http://www.ibm.com/contact"
>> elementFormDefault="qualified">
>>
>> <include schemaLocation="Contact_include.xsd"/>
>>
>> <element name="topcontactname" type="string">
>> <annotation>
>> <appinfo>
>> AppInfo for element "topcontactname".
>> </appinfo>
>> <documentation>
>> Docs for element "topcontactname".
>> </documentation>
>> </annotation>
>> </element>
>>
>> </schema>
>>
>> *Contact_include.xsd*
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified">
>>
>> <element name="contactname" type="string">
>> <annotation>
>> <appinfo>
>> AppInfo for element "contactname".
>> </appinfo>
>> <documentation>
>> Docs for element "contactname".
>> </documentation>
>> </annotation>
>> </element>
>>
>> </schema>
>>
>> I can successfully get the Annotations in toplevel.xsd but not
>> Contact_include.xsd. I've attached a sample plugin that adds a
>> context menu for *.xsd called 'Parse XSD with Include and
>> Annotation'. It will present an informational dialog with
>> information received interrogating the XSD api.
>>
>> Is there something else I need to do? I'm running with the latest
>> XSD code.
>>
>> Thanks in advance,
>> Steve
>
>

--------------040007030008060805040707
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">
Ed,<br>
<br>
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=88092">Bug #88092</a>
has been created for this.<br>
<br>
Thanks for the quick reply and patch.&nbsp; I did make the code change and
works like a charm (not that I had any doubts ;-)<br>
<br>
Steve<br>
<br>
Ed Merks wrote:
<blockquote cite="midd17660$spo$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Steve,<br>
<br>
You're right.&nbsp; For cloned/incorporated schemas, the annotation
information is not all available.&nbsp; I think <b>these </b>lines need to
be added in XSDAnnotationImpl:<br>
<blockquote><small>&nbsp; public XSDConcreteComponent
cloneConcreteComponent(boolean deep, boolean shareDOM)</small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; XSDAnnotationImpl clonedAnnotation =
(XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();</small ><br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = true;</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; if (shareDOM)</small><br>
<small>&nbsp;&nbsp;&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element element = getElement();</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (element != null)</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; clonedAnnotation.setElement(element);</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getUserInformation().addAll(getUserInformat ion()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getAttributes().addAll(getAttributes());</b ></small><br>
<small>&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = shareDOM;</small><br>
<small>&nbsp;&nbsp;&nbsp; return clonedAnnotation;</small><br>
<small>&nbsp; }</small><br>
</blockquote>
Please open a bugzilla and I'll commit this change.&nbsp; (Thanks for the
nice testcase!)<br>
<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd16ufu$ed3$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
I'm attempting to load a schema that includes another schema.&nbsp; In the
process, I'm attempting to access the declared elements in the included
schema...namely the appinfo and documentation.&nbsp; I can read it fine for
the top-level schema.<br>
<br>
Here's a sample schemas:<br>
<blockquote><tt><b>toplevel.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> <br>
&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;<br>
<br>
&nbsp; &lt;element name="topcontactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
<br>
<b>Contact_include.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;element name="contactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
</tt></blockquote>
I can successfully get the Annotations in toplevel.xsd but not
Contact_include.xsd.&nbsp; I've attached a sample plugin that adds a context
menu for *.xsd called 'Parse XSD with Include and Annotation'.&nbsp; It will
present an informational dialog with information received interrogating
the XSD api.<br>
<br>
Is there something else I need to do?&nbsp; I'm running with the latest XSD
code.<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</blockquote>
</body>
</html>

--------------040007030008060805040707--
Re: Problems getting appinfo and documentation from included schemas [message #594508 is a reply to message #58565] Tue, 15 March 2005 17:31 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050609050705010500070607
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Steve,

You're right. For cloned/incorporated schemas, the annotation
information is not all available. I think *these *lines need to be
added in XSDAnnotationImpl:

public XSDConcreteComponent cloneConcreteComponent(boolean deep,
boolean shareDOM)
{
XSDAnnotationImpl clonedAnnotation =
(XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();
clonedAnnotation.isReconciling = true;

if (shareDOM)
{
Element element = getElement();
if (element != null)
{
clonedAnnotation.setElement(element);
}

*
clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation());*
*
clonedAnnotation.getUserInformation().addAll(getUserInformat ion());*
* clonedAnnotation.getAttributes().addAll(getAttributes());*
}

clonedAnnotation.isReconciling = shareDOM;
return clonedAnnotation;
}

Please open a bugzilla and I'll commit this change. (Thanks for the
nice testcase!)



Steve Speicher wrote:

> I'm attempting to load a schema that includes another schema. In the
> process, I'm attempting to access the declared elements in the
> included schema...namely the appinfo and documentation. I can read it
> fine for the top-level schema.
>
> Here's a sample schemas:
>
> *toplevel.xsd*
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:contact="http://www.ibm.com/contact"
> xmlns:cntadv="http://www.ibm.com/contact/advanced"
> targetNamespace="http://www.ibm.com/contact"
> elementFormDefault="qualified">
>
> <include schemaLocation="Contact_include.xsd"/>
>
> <element name="topcontactname" type="string">
> <annotation>
> <appinfo>
> AppInfo for element "topcontactname".
> </appinfo>
> <documentation>
> Docs for element "topcontactname".
> </documentation>
> </annotation>
> </element>
>
> </schema>
>
> *Contact_include.xsd*
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
>
> <element name="contactname" type="string">
> <annotation>
> <appinfo>
> AppInfo for element "contactname".
> </appinfo>
> <documentation>
> Docs for element "contactname".
> </documentation>
> </annotation>
> </element>
>
> </schema>
>
> I can successfully get the Annotations in toplevel.xsd but not
> Contact_include.xsd. I've attached a sample plugin that adds a
> context menu for *.xsd called 'Parse XSD with Include and
> Annotation'. It will present an informational dialog with information
> received interrogating the XSD api.
>
> Is there something else I need to do? I'm running with the latest XSD
> code.
>
> Thanks in advance,
> Steve



--------------050609050705010500070607
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">
</head>
<body bgcolor="#ffffff" text="#000000">
Steve,<br>
<br>
You're right.&nbsp; For cloned/incorporated schemas, the annotation
information is not all available.&nbsp; I think <b>these </b>lines need to
be added in XSDAnnotationImpl:<br>
<blockquote><small>&nbsp; public XSDConcreteComponent
cloneConcreteComponent(boolean deep, boolean shareDOM)</small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; XSDAnnotationImpl clonedAnnotation =
(XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();</small ><br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = true;</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; if (shareDOM)</small><br>
<small>&nbsp;&nbsp;&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element element = getElement();</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (element != null)</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; clonedAnnotation.setElement(element);</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getUserInformation().addAll(getUserInformat ion()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getAttributes().addAll(getAttributes());</b ></small><br>
<small>&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = shareDOM;</small><br>
<small>&nbsp;&nbsp;&nbsp; return clonedAnnotation;</small><br>
<small>&nbsp; }</small><br>
</blockquote>
Please open a bugzilla and I'll commit this change.&nbsp; (Thanks for the
nice testcase!)<br>
<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd16ufu$ed3$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
I'm attempting to load a schema that includes another schema.&nbsp; In the
process, I'm attempting to access the declared elements in the included
schema...namely the appinfo and documentation.&nbsp; I can read it fine for
the top-level schema.<br>
<br>
Here's a sample schemas:<br>
<blockquote><tt><b>toplevel.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> <br>
&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;<br>
<br>
&nbsp; &lt;element name="topcontactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
<br>
<b>Contact_include.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;element name="contactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
</tt></blockquote>
I can successfully get the Annotations in toplevel.xsd but not
Contact_include.xsd.&nbsp; I've attached a sample plugin that adds a context
menu for *.xsd called 'Parse XSD with Include and Annotation'.&nbsp; It will
present an informational dialog with information received interrogating
the XSD api.<br>
<br>
Is there something else I need to do?&nbsp; I'm running with the latest XSD
code.<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</body>
</html>

--------------050609050705010500070607--
Re: Problems getting appinfo and documentation from included schemas [message #594518 is a reply to message #58600] Tue, 15 March 2005 19:03 Go to previous message
Steve Speicher is currently offline Steve Speicher
Messages: 85
Registered: July 2009
Member

This is a multi-part message in MIME format.
--------------040007030008060805040707
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ed,

Bug #88092 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=88092> has
been created for this.

Thanks for the quick reply and patch. I did make the code change and
works like a charm (not that I had any doubts ;-)

Steve

Ed Merks wrote:

> Steve,
>
> You're right. For cloned/incorporated schemas, the annotation
> information is not all available. I think *these *lines need to be
> added in XSDAnnotationImpl:
>
> public XSDConcreteComponent cloneConcreteComponent(boolean deep,
> boolean shareDOM)
> {
> XSDAnnotationImpl clonedAnnotation =
> (XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();
> clonedAnnotation.isReconciling = true;
>
> if (shareDOM)
> {
> Element element = getElement();
> if (element != null)
> {
> clonedAnnotation.setElement(element);
> }
>
> *
> clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation());*
> *
> clonedAnnotation.getUserInformation().addAll(getUserInformat ion());*
> * clonedAnnotation.getAttributes().addAll(getAttributes());*
> }
>
> clonedAnnotation.isReconciling = shareDOM;
> return clonedAnnotation;
> }
>
> Please open a bugzilla and I'll commit this change. (Thanks for the
> nice testcase!)
>
>
>
> Steve Speicher wrote:
>
>> I'm attempting to load a schema that includes another schema. In the
>> process, I'm attempting to access the declared elements in the
>> included schema...namely the appinfo and documentation. I can read
>> it fine for the top-level schema.
>>
>> Here's a sample schemas:
>>
>> *toplevel.xsd*
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> xmlns:contact="http://www.ibm.com/contact"
>> xmlns:cntadv="http://www.ibm.com/contact/advanced"
>> targetNamespace="http://www.ibm.com/contact"
>> elementFormDefault="qualified">
>>
>> <include schemaLocation="Contact_include.xsd"/>
>>
>> <element name="topcontactname" type="string">
>> <annotation>
>> <appinfo>
>> AppInfo for element "topcontactname".
>> </appinfo>
>> <documentation>
>> Docs for element "topcontactname".
>> </documentation>
>> </annotation>
>> </element>
>>
>> </schema>
>>
>> *Contact_include.xsd*
>> <?xml version="1.0" encoding="UTF-8"?>
>> <schema xmlns="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified">
>>
>> <element name="contactname" type="string">
>> <annotation>
>> <appinfo>
>> AppInfo for element "contactname".
>> </appinfo>
>> <documentation>
>> Docs for element "contactname".
>> </documentation>
>> </annotation>
>> </element>
>>
>> </schema>
>>
>> I can successfully get the Annotations in toplevel.xsd but not
>> Contact_include.xsd. I've attached a sample plugin that adds a
>> context menu for *.xsd called 'Parse XSD with Include and
>> Annotation'. It will present an informational dialog with
>> information received interrogating the XSD api.
>>
>> Is there something else I need to do? I'm running with the latest
>> XSD code.
>>
>> Thanks in advance,
>> Steve
>
>

--------------040007030008060805040707
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">
Ed,<br>
<br>
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=88092">Bug #88092</a>
has been created for this.<br>
<br>
Thanks for the quick reply and patch.&nbsp; I did make the code change and
works like a charm (not that I had any doubts ;-)<br>
<br>
Steve<br>
<br>
Ed Merks wrote:
<blockquote cite="midd17660$spo$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Steve,<br>
<br>
You're right.&nbsp; For cloned/incorporated schemas, the annotation
information is not all available.&nbsp; I think <b>these </b>lines need to
be added in XSDAnnotationImpl:<br>
<blockquote><small>&nbsp; public XSDConcreteComponent
cloneConcreteComponent(boolean deep, boolean shareDOM)</small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; XSDAnnotationImpl clonedAnnotation =
(XSDAnnotationImpl)getXSDFactory().createXSDAnnotation();</small ><br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = true;</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; if (shareDOM)</small><br>
<small>&nbsp;&nbsp;&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Element element = getElement();</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (element != null)</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</small><br>
<small> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; clonedAnnotation.setElement(element);</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getApplicationInformation().addAll(getAppli cationInformation()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getUserInformation().addAll(getUserInformat ion()); </b></small><br>
<small><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
clonedAnnotation.getAttributes().addAll(getAttributes());</b ></small><br>
<small>&nbsp;&nbsp;&nbsp; }</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; clonedAnnotation.isReconciling = shareDOM;</small><br>
<small>&nbsp;&nbsp;&nbsp; return clonedAnnotation;</small><br>
<small>&nbsp; }</small><br>
</blockquote>
Please open a bugzilla and I'll commit this change.&nbsp; (Thanks for the
nice testcase!)<br>
<br>
<br>
<br>
Steve Speicher wrote:
<blockquote cite="midd16ufu$ed3$1@www.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
I'm attempting to load a schema that includes another schema.&nbsp; In the
process, I'm attempting to access the declared elements in the included
schema...namely the appinfo and documentation.&nbsp; I can read it fine for
the top-level schema.<br>
<br>
Here's a sample schemas:<br>
<blockquote><tt><b>toplevel.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:contact=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a>
xmlns:cntadv=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact/advanced">"http://www.ibm.com/contact/advanced"</a>
targetNamespace=<a class="moz-txt-link-rfc2396E"
href="http://www.ibm.com/contact">"http://www.ibm.com/contact"</a> <br>
&nbsp;&nbsp;&nbsp; elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;include schemaLocation="Contact_include.xsd"/&gt;<br>
<br>
&nbsp; &lt;element name="topcontactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "topcontactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
<br>
<b>Contact_include.xsd</b><br>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;schema xmlns=<a class="moz-txt-link-rfc2396E"
href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
elementFormDefault="qualified"&gt;<br>
<br>
&nbsp; &lt;element name="contactname" type="string"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;annotation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; AppInfo for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/appinfo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Docs for element "contactname".<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/documentation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/annotation&gt;<br>
&nbsp; &lt;/element&gt;<br>
<br>
&lt;/schema&gt;<br>
</tt></blockquote>
I can successfully get the Annotations in toplevel.xsd but not
Contact_include.xsd.&nbsp; I've attached a sample plugin that adds a context
menu for *.xsd called 'Parse XSD with Include and Annotation'.&nbsp; It will
present an informational dialog with information received interrogating
the XSD api.<br>
<br>
Is there something else I need to do?&nbsp; I'm running with the latest XSD
code.<br>
<br>
Thanks in advance,<br>
Steve<br>
</blockquote>
<br>
</blockquote>
</body>
</html>

--------------040007030008060805040707--
Previous Topic:Problems getting appinfo and documentation from included schemas
Next Topic:POLL: Looking for head count & feedback from Max OS X users (Attn: Mac Users / Developers / Depl
Goto Forum:
  


Current Time: Tue Oct 21 05:43:49 GMT 2014

Powered by FUDForum. Page generated in 0.27675 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software