File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading xsd from java

 
suresh reddy reddy
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,can any one help me on how to read the below given xsd file and prepare html file

............
<xs:attribute name="type" use="optional">
<xs:annotation>
<xs:documentation>"seqnum" - Unique by system generated sequence number. </xs:documentation>
<xs:documentation>"code" - Unique by code string.</xs:documentation>
</xs:annotation>
...........



Thanks in advance
Regards
suresh
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What, exactly, do you mean by "read"? If you want to treat it as XML, then the easiest way to transform it into HTML would be to use an XSLT transformation.
 
suresh reddy reddy
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for reply,

my requirement is like this
Get the data from xsd (through java code ) file and prepare html ,is it possible ,if possible example please....

Regards
Suresh
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is "the data" - you need to be specific. How would the generated HTML look like for the code you posted above?
 
suresh reddy reddy
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
say one file like test.xsd which contains data
.........
<xs:attribute name="type" use="optional">
<xs:annotation>
<xs:documentation>"seqnum" - Unique by system generated sequence number. </xs:documentation>
<xs:documentation>"code" - Unique by code string.</xs:documentation>
</xs:annotation>
....................


in the above sample code i want 1. "seqnum" - Unique by system generated sequence number.
2. "code" - Unique by code string.

in dropdown box of html

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use XPath to grab the "xs:documentation" nodes, and then retrieve the child node that contains the nested text.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic