Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » i want to make a tree(control) from a XSD file
i want to make a tree(control) from a XSD file [message #51319] Tue, 24 August 2004 05:37 Go to next message
Eclipse UserFriend
Originally posted by: feminie.hanmail.net

hi,

as i wrote the title of this article, i want to make a tree(control) from a
XSD file

but i can't load a XSD file.. T.T please help me
and let me know how can I parsing XSD file and make the tree(control)

Thanks,
Re: i want to make a tree(control) from a XSD file [message #51487 is a reply to message #51319] Tue, 24 August 2004 11:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Cheolmin,

You mean a tree view just like in the Sample XML Schema editor? Have a
look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.


Cheolmin Shin wrote:

>hi,
>
>as i wrote the title of this article, i want to make a tree(control) from a
>XSD file
>
>but i can't load a XSD file.. T.T please help me
>and let me know how can I parsing XSD file and make the tree(control)
>
>Thanks,
>
>
>
>
you got the point but...... [message #51586 is a reply to message #51487] Wed, 25 August 2004 06:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: feminie.hanmail.net

you knew my point exactly.
but I got the error when I tried load an XSD

I debugged that method loadAndPrint() in XSDMainTest class

public void loadAndPrint(String xsdFile)
throws Exception
{
File file = new File(xsdFile);
URI uri;
if(file.isFile())
uri = URI.createFileURI(file.getCanonicalFile().toString());
else
uri = URI.createURI(xsdFile);
ResourceSet resourceSet = new ResourceSetImpl();
XSDResourceImpl xsdMainResource =
(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
xsdMainResource.setURI(uri);
xsdMainResource.load(resourceSet.getLoadOptions()); <----------
this line has occured exception
...

this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class

public void load(Map options) throws IOException
{
if (!isLoaded)
{
URIConverter uriConverter = getURIConverter();
InputStream inputStream = uriConverter.createInputStream(getURI());
try
{
load(inputStream, options); <---------- this line has occured
exception
}
finally
{
inputStream.close();
}
}

exception is MissingResourceException

I have no idea about this error, so I couldn't load an XSD now.... but in
EMF project, I can load xsd file without any error

when I run this codes, I can get parsed document object

xsdParser = new XSDParser();
XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
xsdParser.setSchema(xsdSchema);
xsdParser.parse(uri);
xmlDoc = xsdParser.getDocument();

but this codes don't work properly.

Element rootElement = xmlDOM.getDocumentElement();
xsdSchema.setElement(rootElement); <--- this method cause exception

what is the reason why this thing happen? and how can I solve this problem,
please let me know and help

one more thing!
how can I use org.eclipse.xsd.presentation.XSDEditor class for my project as
a module to insert
I can't import org.eclipse.xsd.presentation namespace.


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:<cgf9vf$uv3$1@eclipse.org>...
> Cheolmin,
>
> You mean a tree view just like in the Sample XML Schema editor? Have a
> look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>
>
> Cheolmin Shin wrote:
>
> >hi,
> >
> >as i wrote the title of this article, i want to make a tree(control) from
a
> >XSD file
> >
> >but i can't load a XSD file.. T.T please help me
> >and let me know how can I parsing XSD file and make the tree(control)
> >
> >Thanks,
> >
> >
> >
> >
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:cgf9vf$uv3$1@eclipse.org...
> Cheolmin,
>
> You mean a tree view just like in the Sample XML Schema editor? Have a
> look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>
>
> Cheolmin Shin wrote:
>
> >hi,
> >
> >as i wrote the title of this article, i want to make a tree(control) from
a
> >XSD file
> >
> >but i can't load a XSD file.. T.T please help me
> >and let me know how can I parsing XSD file and make the tree(control)
> >
> >Thanks,
> >
> >
> >
> >
this is stacktrace [message #51612 is a reply to message #51586] Wed, 25 August 2004 06:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: feminie.hanmail.net

java.util.MissingResourceException: Missing properties:
org/eclipse/xsd/plugin.properties
at org.eclipse.emf.common.EMFPlugin.getBaseURL(EMFPlugin.java:1 17)
at
org.eclipse.xsd.impl.XSDSchemaImpl.getSchemaInstance(XSDSche maImpl.java:687)
at
org.eclipse.xsd.impl.XSDSchemaImpl.resolveSchema(XSDSchemaIm pl.java:2020)
at org.eclipse.xsd.impl.XSDSchemaImpl.patch(XSDSchemaImpl.java: 1465)
at
org.eclipse.xsd.impl.XSDSchemaImpl.changeAttribute(XSDSchema Impl.java:2221)
at
org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDCon creteComponentIm
pl.java:1202)
at
org.eclipse.xsd.impl.XSDSchemaImpl.setSchemaLocation(XSDSche maImpl.java:822)
at org.eclipse.xsd.util.XSDResourceImpl.doLoad(XSDResourceImpl. java:470)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:867)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:741)
at org.eclipse.xsd.examples.infosetTest.loadAndPrint(infosetTes t.java:200)
at
org.eclipse.xsd.examples.EclipseXSDDemo2.xsdParsingResult(Ec lipseXSDDemo2.ja
va:169)
at org.eclipse.xsd.examples.EclipseXSDDemo2.main(EclipseXSDDemo 2.java:180)


my code call that loadAndPrint() method
XSDMainTest myMainTest = new XSDMainTest();
myMainTest.loadAndPrint("d:\\project\\po.xsd");
Re: you got the point but...... [message #51632 is a reply to message #51586] Wed, 25 August 2004 11:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------050402010700060307060302
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Cheolmin,

When using XSD standalone, you must include xsd.resource.jar on the
classpath (or it won't be able to find plugin.properties). Without
seeing a stack trace for your setElement problem, I can only guess as to
the problem, and I don't think you've even given me enough clues to
guess. To use org.eclipse.xsd.editor in your own project, you need to
add a dependency for it to your plugin.xml.


Cheolmin Shin wrote:

>you knew my point exactly.
>but I got the error when I tried load an XSD
>
>I debugged that method loadAndPrint() in XSDMainTest class
>
> public void loadAndPrint(String xsdFile)
> throws Exception
> {
> File file = new File(xsdFile);
> URI uri;
> if(file.isFile())
> uri = URI.createFileURI(file.getCanonicalFile().toString());
> else
> uri = URI.createURI(xsdFile);
> ResourceSet resourceSet = new ResourceSetImpl();
> XSDResourceImpl xsdMainResource =
>(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
> xsdMainResource.setURI(uri);
> xsdMainResource.load(resourceSet.getLoadOptions()); <----------
>this line has occured exception
> ...
>
>this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class
>
> public void load(Map options) throws IOException
> {
> if (!isLoaded)
> {
> URIConverter uriConverter = getURIConverter();
> InputStream inputStream = uriConverter.createInputStream(getURI());
> try
> {
> load(inputStream, options); <---------- this line has occured
>exception
> }
> finally
> {
> inputStream.close();
> }
> }
>
>exception is MissingResourceException
>
>I have no idea about this error, so I couldn't load an XSD now.... but in
>EMF project, I can load xsd file without any error
>
>when I run this codes, I can get parsed document object
>
>xsdParser = new XSDParser();
>XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
>xsdParser.setSchema(xsdSchema);
>xsdParser.parse(uri);
>xmlDoc = xsdParser.getDocument();
>
>but this codes don't work properly.
>
>Element rootElement = xmlDOM.getDocumentElement();
>xsdSchema.setElement(rootElement); <--- this method cause exception
>
>what is the reason why this thing happen? and how can I solve this problem,
>please let me know and help
>
>one more thing!
>how can I use org.eclipse.xsd.presentation.XSDEditor class for my project as
>a module to insert
>I can't import org.eclipse.xsd.presentation namespace.
>
>
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:<cgf9vf$uv3$1@eclipse.org>...
>
>
>>Cheolmin,
>>
>>You mean a tree view just like in the Sample XML Schema editor? Have a
>>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
>>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>>
>>
>>Cheolmin Shin wrote:
>>
>>
>>
>>>hi,
>>>
>>>as i wrote the title of this article, i want to make a tree(control) from
>>>
>>>
>a
>
>
>>>XSD file
>>>
>>>but i can't load a XSD file.. T.T please help me
>>>and let me know how can I parsing XSD file and make the tree(control)
>>>
>>>Thanks,
>>>
>>>
>>>
>>>
>>>
>>>
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:cgf9vf$uv3$1@eclipse.org...
>
>
>>Cheolmin,
>>
>>You mean a tree view just like in the Sample XML Schema editor? Have a
>>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
>>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>>
>>
>>Cheolmin Shin wrote:
>>
>>
>>
>>>hi,
>>>
>>>as i wrote the title of this article, i want to make a tree(control) from
>>>
>>>
>a
>
>
>>>XSD file
>>>
>>>but i can't load a XSD file.. T.T please help me
>>>and let me know how can I parsing XSD file and make the tree(control)
>>>
>>>Thanks,
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>


--------------050402010700060307060302
Content-Type: text/html; charset=us-ascii
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">
Cheolmin,<br>
<br>
When using XSD standalone, you must include xsd.resource.jar on the
classpath (or it won't be able to find plugin.properties).&nbsp;&nbsp; Without
seeing a stack trace for your setElement problem, I can only guess as
to the problem, and I don't think you've even given me enough clues to
guess.&nbsp; To use org.eclipse.xsd.editor in your own project, you need to
add a dependency for it to your plugin.xml.<br>
<br>
<br>
Cheolmin Shin wrote:
<blockquote cite="midcgham9$39i$1@eclipse.org" type="cite">
<pre wrap="">you knew my point exactly.
but I got the error when I tried load an XSD

I debugged that method loadAndPrint() in XSDMainTest class

public void loadAndPrint(String xsdFile)
throws Exception
{
File file = new File(xsdFile);
URI uri;
if(file.isFile())
uri = URI.createFileURI(file.getCanonicalFile().toString());
else
uri = URI.createURI(xsdFile);
ResourceSet resourceSet = new ResourceSetImpl();
XSDResourceImpl xsdMainResource =
(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
xsdMainResource.setURI(uri);
xsdMainResource.load(resourceSet.getLoadOptions()); &lt;----------
this line has occured exception
...

this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class

public void load(Map options) throws IOException
{
if (!isLoaded)
{
URIConverter uriConverter = getURIConverter();
InputStream inputStream = uriConverter.createInputStream(getURI());
try
{
load(inputStream, options); &lt;---------- this line has occured
exception
}
finally
{
inputStream.close();
}
}

exception is MissingResourceException

I have no idea about this error, so I couldn't load an XSD now.... but in
EMF project, I can load xsd file without any error

when I run this codes, I can get parsed document object

xsdParser = new XSDParser();
XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
xsdParser.setSchema(xsdSchema);
xsdParser.parse(uri);
xmlDoc = xsdParser.getDocument();

but this codes don't work properly.

Element rootElement = xmlDOM.getDocumentElement();
xsdSchema.setElement(rootElement); &lt;--- this method cause exception

what is the reason why this thing happen? and how can I solve this problem,
please let me know and help

one more thing!
how can I use org.eclipse.xsd.presentation.XSDEditor class for my project as
a module to insert
I can't import org.eclipse.xsd.presentation namespace.


"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</a> wrote in message
news:<a class="moz-txt-link-rfc2396E" href="mailto:cgf9vf$uv3$1@eclipse.org">&lt;cgf9vf$uv3$1@eclipse.org&gt;</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Cheolmin,

You mean a tree view just like in the Sample XML Schema editor? Have a
look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.


Cheolmin Shin wrote:

</pre>
<blockquote type="cite">
<pre wrap="">hi,

as i wrote the title of this article, i want to make a tree(control) from
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->a
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">XSD file

but i can't load a XSD file.. T.T please help me
and let me know how can I parsing XSD file and make the tree(control)

Thanks,




</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:cgf9vf$uv3$1@eclipse.org">news:cgf9vf$uv3$1@eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Cheolmin,

You mean a tree view just like in the Sample XML Schema editor? Have a
look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.


Cheolmin Shin wrote:

</pre>
<blockquote type="cite">
<pre wrap="">hi,

as i wrote the title of this article, i want to make a tree(control) from
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->a
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">XSD file

but i can't load a XSD file.. T.T please help me
and let me know how can I parsing XSD file and make the tree(control)

Thanks,




</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------050402010700060307060302--
Ed, I did it!! thank you very much ^^; [message #51771 is a reply to message #51632] Thu, 26 August 2004 03:30 Go to previous message
Eclipse UserFriend
Originally posted by: feminie.hanmail.net

Thanks for your help...

I solved that problem(load error) as I include xsd.resource.jar

setElement problem has gone at the same time



"Ed Merks" <merks@ca.ibm.com> wrote in message
news:cght46$2ol$1@eclipse.org...
> Cheolmin,
>
> When using XSD standalone, you must include xsd.resource.jar on the
> classpath (or it won't be able to find plugin.properties). Without
> seeing a stack trace for your setElement problem, I can only guess as to
> the problem, and I don't think you've even given me enough clues to
> guess. To use org.eclipse.xsd.editor in your own project, you need to
> add a dependency for it to your plugin.xml.
>
>
> Cheolmin Shin wrote:
>
> >you knew my point exactly.
> >but I got the error when I tried load an XSD
> >
> >I debugged that method loadAndPrint() in XSDMainTest class
> >
> > public void loadAndPrint(String xsdFile)
> > throws Exception
> > {
> > File file = new File(xsdFile);
> > URI uri;
> > if(file.isFile())
> > uri = URI.createFileURI(file.getCanonicalFile().toString());
> > else
> > uri = URI.createURI(xsdFile);
> > ResourceSet resourceSet = new ResourceSetImpl();
> > XSDResourceImpl xsdMainResource =
> >(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
> > xsdMainResource.setURI(uri);
> > xsdMainResource.load(resourceSet.getLoadOptions()); <----------
> >this line has occured exception
> > ...
> >
> >this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class
> >
> > public void load(Map options) throws IOException
> > {
> > if (!isLoaded)
> > {
> > URIConverter uriConverter = getURIConverter();
> > InputStream inputStream = uriConverter.createInputStream(getURI());
> > try
> > {
> > load(inputStream, options); <---------- this line has occured
> >exception
> > }
> > finally
> > {
> > inputStream.close();
> > }
> > }
> >
> >exception is MissingResourceException
> >
> >I have no idea about this error, so I couldn't load an XSD now.... but
in
> >EMF project, I can load xsd file without any error
> >
> >when I run this codes, I can get parsed document object
> >
> >xsdParser = new XSDParser();
> >XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
> >xsdParser.setSchema(xsdSchema);
> >xsdParser.parse(uri);
> >xmlDoc = xsdParser.getDocument();
> >
> >but this codes don't work properly.
> >
> >Element rootElement = xmlDOM.getDocumentElement();
> >xsdSchema.setElement(rootElement); <--- this method cause exception
> >
> >what is the reason why this thing happen? and how can I solve this
problem,
> >please let me know and help
> >
> >one more thing!
> >how can I use org.eclipse.xsd.presentation.XSDEditor class for my project
as
> >a module to insert
> >I can't import org.eclipse.xsd.presentation namespace.
> >
> >
> >"Ed Merks" <merks@ca.ibm.com> wrote in message
> >news:<cgf9vf$uv3$1@eclipse.org>...
> >
> >
> >>Cheolmin,
> >>
> >>You mean a tree view just like in the Sample XML Schema editor? Have a
> >>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> >>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
> >>
> >>
> >>Cheolmin Shin wrote:
> >>
> >>
> >>
> >>>hi,
> >>>
> >>>as i wrote the title of this article, i want to make a tree(control)
from
> >>>
> >>>
> >a
> >
> >
> >>>XSD file
> >>>
> >>>but i can't load a XSD file.. T.T please help me
> >>>and let me know how can I parsing XSD file and make the tree(control)
> >>>
> >>>Thanks,
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >"Ed Merks" <merks@ca.ibm.com> wrote in message
> >news:cgf9vf$uv3$1@eclipse.org...
> >
> >
> >>Cheolmin,
> >>
> >>You mean a tree view just like in the Sample XML Schema editor? Have a
> >>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> >>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
> >>
> >>
> >>Cheolmin Shin wrote:
> >>
> >>
> >>
> >>>hi,
> >>>
> >>>as i wrote the title of this article, i want to make a tree(control)
from
> >>>
> >>>
> >a
> >
> >
> >>>XSD file
> >>>
> >>>but i can't load a XSD file.. T.T please help me
> >>>and let me know how can I parsing XSD file and make the tree(control)
> >>>
> >>>Thanks,
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
>
>
Re: i want to make a tree(control) from a XSD file [message #590937 is a reply to message #51319] Tue, 24 August 2004 11:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Cheolmin,

You mean a tree view just like in the Sample XML Schema editor? Have a
look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.


Cheolmin Shin wrote:

>hi,
>
>as i wrote the title of this article, i want to make a tree(control) from a
>XSD file
>
>but i can't load a XSD file.. T.T please help me
>and let me know how can I parsing XSD file and make the tree(control)
>
>Thanks,
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
you got the point but...... [message #590993 is a reply to message #51487] Wed, 25 August 2004 06:13 Go to previous message
Eclipse UserFriend
Originally posted by: feminie.hanmail.net

you knew my point exactly.
but I got the error when I tried load an XSD

I debugged that method loadAndPrint() in XSDMainTest class

public void loadAndPrint(String xsdFile)
throws Exception
{
File file = new File(xsdFile);
URI uri;
if(file.isFile())
uri = URI.createFileURI(file.getCanonicalFile().toString());
else
uri = URI.createURI(xsdFile);
ResourceSet resourceSet = new ResourceSetImpl();
XSDResourceImpl xsdMainResource =
(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
xsdMainResource.setURI(uri);
xsdMainResource.load(resourceSet.getLoadOptions()); <----------
this line has occured exception
...

this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class

public void load(Map options) throws IOException
{
if (!isLoaded)
{
URIConverter uriConverter = getURIConverter();
InputStream inputStream = uriConverter.createInputStream(getURI());
try
{
load(inputStream, options); <---------- this line has occured
exception
}
finally
{
inputStream.close();
}
}

exception is MissingResourceException

I have no idea about this error, so I couldn't load an XSD now.... but in
EMF project, I can load xsd file without any error

when I run this codes, I can get parsed document object

xsdParser = new XSDParser();
XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
xsdParser.setSchema(xsdSchema);
xsdParser.parse(uri);
xmlDoc = xsdParser.getDocument();

but this codes don't work properly.

Element rootElement = xmlDOM.getDocumentElement();
xsdSchema.setElement(rootElement); <--- this method cause exception

what is the reason why this thing happen? and how can I solve this problem,
please let me know and help

one more thing!
how can I use org.eclipse.xsd.presentation.XSDEditor class for my project as
a module to insert
I can't import org.eclipse.xsd.presentation namespace.


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:<cgf9vf$uv3$1@eclipse.org>...
> Cheolmin,
>
> You mean a tree view just like in the Sample XML Schema editor? Have a
> look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>
>
> Cheolmin Shin wrote:
>
> >hi,
> >
> >as i wrote the title of this article, i want to make a tree(control) from
a
> >XSD file
> >
> >but i can't load a XSD file.. T.T please help me
> >and let me know how can I parsing XSD file and make the tree(control)
> >
> >Thanks,
> >
> >
> >
> >
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:cgf9vf$uv3$1@eclipse.org...
> Cheolmin,
>
> You mean a tree view just like in the Sample XML Schema editor? Have a
> look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>
>
> Cheolmin Shin wrote:
>
> >hi,
> >
> >as i wrote the title of this article, i want to make a tree(control) from
a
> >XSD file
> >
> >but i can't load a XSD file.. T.T please help me
> >and let me know how can I parsing XSD file and make the tree(control)
> >
> >Thanks,
> >
> >
> >
> >
this is stacktrace [message #591014 is a reply to message #51586] Wed, 25 August 2004 06:59 Go to previous message
Eclipse UserFriend
Originally posted by: feminie.hanmail.net

java.util.MissingResourceException: Missing properties:
org/eclipse/xsd/plugin.properties
at org.eclipse.emf.common.EMFPlugin.getBaseURL(EMFPlugin.java:1 17)
at
org.eclipse.xsd.impl.XSDSchemaImpl.getSchemaInstance(XSDSche maImpl.java:687)
at
org.eclipse.xsd.impl.XSDSchemaImpl.resolveSchema(XSDSchemaIm pl.java:2020)
at org.eclipse.xsd.impl.XSDSchemaImpl.patch(XSDSchemaImpl.java: 1465)
at
org.eclipse.xsd.impl.XSDSchemaImpl.changeAttribute(XSDSchema Impl.java:2221)
at
org.eclipse.xsd.impl.XSDConcreteComponentImpl.eNotify(XSDCon creteComponentIm
pl.java:1202)
at
org.eclipse.xsd.impl.XSDSchemaImpl.setSchemaLocation(XSDSche maImpl.java:822)
at org.eclipse.xsd.util.XSDResourceImpl.doLoad(XSDResourceImpl. java:470)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:867)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:741)
at org.eclipse.xsd.examples.infosetTest.loadAndPrint(infosetTes t.java:200)
at
org.eclipse.xsd.examples.EclipseXSDDemo2.xsdParsingResult(Ec lipseXSDDemo2.ja
va:169)
at org.eclipse.xsd.examples.EclipseXSDDemo2.main(EclipseXSDDemo 2.java:180)


my code call that loadAndPrint() method
XSDMainTest myMainTest = new XSDMainTest();
myMainTest.loadAndPrint("d:\\project\\po.xsd");
Re: you got the point but...... [message #591036 is a reply to message #51586] Wed, 25 August 2004 11:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050402010700060307060302
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Cheolmin,

When using XSD standalone, you must include xsd.resource.jar on the
classpath (or it won't be able to find plugin.properties). Without
seeing a stack trace for your setElement problem, I can only guess as to
the problem, and I don't think you've even given me enough clues to
guess. To use org.eclipse.xsd.editor in your own project, you need to
add a dependency for it to your plugin.xml.


Cheolmin Shin wrote:

>you knew my point exactly.
>but I got the error when I tried load an XSD
>
>I debugged that method loadAndPrint() in XSDMainTest class
>
> public void loadAndPrint(String xsdFile)
> throws Exception
> {
> File file = new File(xsdFile);
> URI uri;
> if(file.isFile())
> uri = URI.createFileURI(file.getCanonicalFile().toString());
> else
> uri = URI.createURI(xsdFile);
> ResourceSet resourceSet = new ResourceSetImpl();
> XSDResourceImpl xsdMainResource =
>(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
> xsdMainResource.setURI(uri);
> xsdMainResource.load(resourceSet.getLoadOptions()); <----------
>this line has occured exception
> ...
>
>this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class
>
> public void load(Map options) throws IOException
> {
> if (!isLoaded)
> {
> URIConverter uriConverter = getURIConverter();
> InputStream inputStream = uriConverter.createInputStream(getURI());
> try
> {
> load(inputStream, options); <---------- this line has occured
>exception
> }
> finally
> {
> inputStream.close();
> }
> }
>
>exception is MissingResourceException
>
>I have no idea about this error, so I couldn't load an XSD now.... but in
>EMF project, I can load xsd file without any error
>
>when I run this codes, I can get parsed document object
>
>xsdParser = new XSDParser();
>XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
>xsdParser.setSchema(xsdSchema);
>xsdParser.parse(uri);
>xmlDoc = xsdParser.getDocument();
>
>but this codes don't work properly.
>
>Element rootElement = xmlDOM.getDocumentElement();
>xsdSchema.setElement(rootElement); <--- this method cause exception
>
>what is the reason why this thing happen? and how can I solve this problem,
>please let me know and help
>
>one more thing!
>how can I use org.eclipse.xsd.presentation.XSDEditor class for my project as
>a module to insert
>I can't import org.eclipse.xsd.presentation namespace.
>
>
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:<cgf9vf$uv3$1@eclipse.org>...
>
>
>>Cheolmin,
>>
>>You mean a tree view just like in the Sample XML Schema editor? Have a
>>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
>>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>>
>>
>>Cheolmin Shin wrote:
>>
>>
>>
>>>hi,
>>>
>>>as i wrote the title of this article, i want to make a tree(control) from
>>>
>>>
>a
>
>
>>>XSD file
>>>
>>>but i can't load a XSD file.. T.T please help me
>>>and let me know how can I parsing XSD file and make the tree(control)
>>>
>>>Thanks,
>>>
>>>
>>>
>>>
>>>
>>>
>"Ed Merks" <merks@ca.ibm.com> wrote in message
>news:cgf9vf$uv3$1@eclipse.org...
>
>
>>Cheolmin,
>>
>>You mean a tree view just like in the Sample XML Schema editor? Have a
>>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
>>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
>>
>>
>>Cheolmin Shin wrote:
>>
>>
>>
>>>hi,
>>>
>>>as i wrote the title of this article, i want to make a tree(control) from
>>>
>>>
>a
>
>
>>>XSD file
>>>
>>>but i can't load a XSD file.. T.T please help me
>>>and let me know how can I parsing XSD file and make the tree(control)
>>>
>>>Thanks,
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>
>


--------------050402010700060307060302
Content-Type: text/html; charset=us-ascii
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">
Cheolmin,<br>
<br>
When using XSD standalone, you must include xsd.resource.jar on the
classpath (or it won't be able to find plugin.properties).&nbsp;&nbsp; Without
seeing a stack trace for your setElement problem, I can only guess as
to the problem, and I don't think you've even given me enough clues to
guess.&nbsp; To use org.eclipse.xsd.editor in your own project, you need to
add a dependency for it to your plugin.xml.<br>
<br>
<br>
Cheolmin Shin wrote:
<blockquote cite="midcgham9$39i$1@eclipse.org" type="cite">
<pre wrap="">you knew my point exactly.
but I got the error when I tried load an XSD

I debugged that method loadAndPrint() in XSDMainTest class

public void loadAndPrint(String xsdFile)
throws Exception
{
File file = new File(xsdFile);
URI uri;
if(file.isFile())
uri = URI.createFileURI(file.getCanonicalFile().toString());
else
uri = URI.createURI(xsdFile);
ResourceSet resourceSet = new ResourceSetImpl();
XSDResourceImpl xsdMainResource =
(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
xsdMainResource.setURI(uri);
xsdMainResource.load(resourceSet.getLoadOptions()); &lt;----------
this line has occured exception
...

this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class

public void load(Map options) throws IOException
{
if (!isLoaded)
{
URIConverter uriConverter = getURIConverter();
InputStream inputStream = uriConverter.createInputStream(getURI());
try
{
load(inputStream, options); &lt;---------- this line has occured
exception
}
finally
{
inputStream.close();
}
}

exception is MissingResourceException

I have no idea about this error, so I couldn't load an XSD now.... but in
EMF project, I can load xsd file without any error

when I run this codes, I can get parsed document object

xsdParser = new XSDParser();
XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
xsdParser.setSchema(xsdSchema);
xsdParser.parse(uri);
xmlDoc = xsdParser.getDocument();

but this codes don't work properly.

Element rootElement = xmlDOM.getDocumentElement();
xsdSchema.setElement(rootElement); &lt;--- this method cause exception

what is the reason why this thing happen? and how can I solve this problem,
please let me know and help

one more thing!
how can I use org.eclipse.xsd.presentation.XSDEditor class for my project as
a module to insert
I can't import org.eclipse.xsd.presentation namespace.


"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</a> wrote in message
news:<a class="moz-txt-link-rfc2396E" href="mailto:cgf9vf$uv3$1@eclipse.org">&lt;cgf9vf$uv3$1@eclipse.org&gt;</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Cheolmin,

You mean a tree view just like in the Sample XML Schema editor? Have a
look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.


Cheolmin Shin wrote:

</pre>
<blockquote type="cite">
<pre wrap="">hi,

as i wrote the title of this article, i want to make a tree(control) from
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->a
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">XSD file

but i can't load a XSD file.. T.T please help me
and let me know how can I parsing XSD file and make the tree(control)

Thanks,




</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:cgf9vf$uv3$1@eclipse.org">news:cgf9vf$uv3$1@eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Cheolmin,

You mean a tree view just like in the Sample XML Schema editor? Have a
look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.


Cheolmin Shin wrote:

</pre>
<blockquote type="cite">
<pre wrap="">hi,

as i wrote the title of this article, i want to make a tree(control) from
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->a
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">XSD file

but i can't load a XSD file.. T.T please help me
and let me know how can I parsing XSD file and make the tree(control)

Thanks,




</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------050402010700060307060302--


Ed Merks
Professional Support: https://www.macromodeling.com/
Ed, I did it!! thank you very much ^^; [message #591089 is a reply to message #51632] Thu, 26 August 2004 03:30 Go to previous message
Eclipse UserFriend
Originally posted by: feminie.hanmail.net

Thanks for your help...

I solved that problem(load error) as I include xsd.resource.jar

setElement problem has gone at the same time



"Ed Merks" <merks@ca.ibm.com> wrote in message
news:cght46$2ol$1@eclipse.org...
> Cheolmin,
>
> When using XSD standalone, you must include xsd.resource.jar on the
> classpath (or it won't be able to find plugin.properties). Without
> seeing a stack trace for your setElement problem, I can only guess as to
> the problem, and I don't think you've even given me enough clues to
> guess. To use org.eclipse.xsd.editor in your own project, you need to
> add a dependency for it to your plugin.xml.
>
>
> Cheolmin Shin wrote:
>
> >you knew my point exactly.
> >but I got the error when I tried load an XSD
> >
> >I debugged that method loadAndPrint() in XSDMainTest class
> >
> > public void loadAndPrint(String xsdFile)
> > throws Exception
> > {
> > File file = new File(xsdFile);
> > URI uri;
> > if(file.isFile())
> > uri = URI.createFileURI(file.getCanonicalFile().toString());
> > else
> > uri = URI.createURI(xsdFile);
> > ResourceSet resourceSet = new ResourceSetImpl();
> > XSDResourceImpl xsdMainResource =
> >(XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd "));
> > xsdMainResource.setURI(uri);
> > xsdMainResource.load(resourceSet.getLoadOptions()); <----------
> >this line has occured exception
> > ...
> >
> >this is org.eclipse.emf.ecore.resource.impl.ResourceImpl class
> >
> > public void load(Map options) throws IOException
> > {
> > if (!isLoaded)
> > {
> > URIConverter uriConverter = getURIConverter();
> > InputStream inputStream = uriConverter.createInputStream(getURI());
> > try
> > {
> > load(inputStream, options); <---------- this line has occured
> >exception
> > }
> > finally
> > {
> > inputStream.close();
> > }
> > }
> >
> >exception is MissingResourceException
> >
> >I have no idea about this error, so I couldn't load an XSD now.... but
in
> >EMF project, I can load xsd file without any error
> >
> >when I run this codes, I can get parsed document object
> >
> >xsdParser = new XSDParser();
> >XSDSchema xsdSchema = XSDFactory.eINSTANCE.createXSDSchema();
> >xsdParser.setSchema(xsdSchema);
> >xsdParser.parse(uri);
> >xmlDoc = xsdParser.getDocument();
> >
> >but this codes don't work properly.
> >
> >Element rootElement = xmlDOM.getDocumentElement();
> >xsdSchema.setElement(rootElement); <--- this method cause exception
> >
> >what is the reason why this thing happen? and how can I solve this
problem,
> >please let me know and help
> >
> >one more thing!
> >how can I use org.eclipse.xsd.presentation.XSDEditor class for my project
as
> >a module to insert
> >I can't import org.eclipse.xsd.presentation namespace.
> >
> >
> >"Ed Merks" <merks@ca.ibm.com> wrote in message
> >news:<cgf9vf$uv3$1@eclipse.org>...
> >
> >
> >>Cheolmin,
> >>
> >>You mean a tree view just like in the Sample XML Schema editor? Have a
> >>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> >>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
> >>
> >>
> >>Cheolmin Shin wrote:
> >>
> >>
> >>
> >>>hi,
> >>>
> >>>as i wrote the title of this article, i want to make a tree(control)
from
> >>>
> >>>
> >a
> >
> >
> >>>XSD file
> >>>
> >>>but i can't load a XSD file.. T.T please help me
> >>>and let me know how can I parsing XSD file and make the tree(control)
> >>>
> >>>Thanks,
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >"Ed Merks" <merks@ca.ibm.com> wrote in message
> >news:cgf9vf$uv3$1@eclipse.org...
> >
> >
> >>Cheolmin,
> >>
> >>You mean a tree view just like in the Sample XML Schema editor? Have a
> >>look at org.eclipse.xsd.presentation.XSDEditor for that. The sample in
> >>org.eclipse.xsd.test.XSDMainTest will help you with how to load an XSD.
> >>
> >>
> >>Cheolmin Shin wrote:
> >>
> >>
> >>
> >>>hi,
> >>>
> >>>as i wrote the title of this article, i want to make a tree(control)
from
> >>>
> >>>
> >a
> >
> >
> >>>XSD file
> >>>
> >>>but i can't load a XSD file.. T.T please help me
> >>>and let me know how can I parsing XSD file and make the tree(control)
> >>>
> >>>Thanks,
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
>
>
Previous Topic:XML and C/C++
Next Topic:XML and C/C++
Goto Forum:
  


Current Time: Fri Apr 19 13:27:18 GMT 2024

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

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

Back to the top