Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Linking Style Sheets and Schemas

Reply
Thread Tools

Linking Style Sheets and Schemas

 
 
HugeBob
Guest
Posts: n/a
 
      03-19-2009
Hi All,

I'm writing a class that generates an XML file using the W3C DOM with
data retrieved from a JDBC connection. I've successfully gotten the
XML generated. But, the exercise requires us to link the resulting
XML file to CSS and schema file. But, I don't know how to link them.
Basically, I need the following to show up in my XML file:

<?xml-stylesheet type="text/css" href="my.css" ?>
<my:jdbcexer xmlnssd="http://www.w3.org/2001/XMLSchema"
xmlns:my="http://web3.myworld.edu/sports"
xsd:schemaLocation="http://web3.myworld.edu/sports sports.xsd">

How would this be done in Java?
 
Reply With Quote
 
 
 
 
Owen Jacobson
Guest
Posts: n/a
 
      03-19-2009
On 2009-03-18 23:51:24 -0400, HugeBob <> said:

> Hi All,
>
> I'm writing a class that generates an XML file using the W3C DOM with
> data retrieved from a JDBC connection. I've successfully gotten the
> XML generated. But, the exercise requires us to link the resulting
> XML file to CSS and schema file. But, I don't know how to link them.
> Basically, I need the following to show up in my XML file:
>
> <?xml-stylesheet type="text/css" href="my.css" ?>
> <my:jdbcexer xmlnssd="http://www.w3.org/2001/XMLSchema"
> xmlns:my="http://web3.myworld.edu/sports"
> xsd:schemaLocation="http://web3.myworld.edu/sports sports.xsd">
>
> How would this be done in Java?


The fragment enclosed in <? ?> is called a processing instruction. I'm
not intimately familiar with the org.w3c.dom package, but there may be
a way to add PI nodes to the document tree - the package has a
ProcessingInstruction class which might be suitable.

HTH,
-o

 
Reply With Quote
 
 
 
 
Huge B.
Guest
Posts: n/a
 
      03-20-2009
On Mar 18, 11:56 pm, Owen Jacobson <angrybald...@gmail.com> wrote:
> On 2009-03-18 23:51:24 -0400, HugeBob <rnu...@gmail.com> said:
>
> > Hi All,

>
> > I'm writing a class that generates an XML file using the W3C DOM with
> > data retrieved from a JDBC connection. I've successfully gotten the
> > XML generated. But, the exercise requires us to link the resulting
> > XML file to CSS and schema file. But, I don't know how to link them.
> > Basically, I need the following to show up in my XML file:

>
> > <?xml-stylesheet type="text/css" href="my.css" ?>
> > <my:jdbcexer xmlnssd="http://www.w3.org/2001/XMLSchema"
> > xmlns:my="http://web3.myworld.edu/sports"
> > xsd:schemaLocation="http://web3.myworld.edu/sportssports.xsd">

>
> > How would this be done in Java?

>
> The fragment enclosed in <? ?> is called a processing instruction. I'm
> not intimately familiar with the org.w3c.dom package, but there may be
> a way to add PI nodes to the document tree - the package has a
> ProcessingInstruction class which might be suitable.
>
> HTH,
> -o


Thanks for your input. I used the CreateProcessingInstruction(...)
method to append this info to the document. Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I get the style sheets (or style object) of the wholedocument? Jake Barnes Javascript 6 04-12-2009 08:15 AM
Style sheets and XML Strict =?Utf-8?B?RHlsYW4gVGhvbWFz?= ASP .Net 2 03-22-2005 07:18 PM
Styles and Cascading Style Sheets JezB ASP .Net 5 04-30-2004 02:40 PM
Style sheets, include one style within another (not inheritance) foldface@yahoo.co.uk HTML 1 11-24-2003 01:37 PM
export to Excel - multiple sheets & renaming sheets Carl Corcoran ASP General 1 11-12-2003 07:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57