RE: dumping XML document

2007-01-04 Thread Kralidis,Tom [Burlington]
 

 -Original Message-
 From: Kris Schneider [mailto:[EMAIL PROTECTED] 
 Sent: 03 January, 2007 10:40 AM
 To: Tag Libraries Users List
 Subject: Re: dumping XML document
 
 Kralidis,Tom [Burlington] wrote:
  Hi,
  
  Using tomcat 6.0.0, I am using the following fragment to fetch a 
  remote XML document:
  
  c:catch var=caught
   c:import url=${param.url} varReader=xmlSource
x:parse var=doc xml=${xmlSource} scope=page /  
 /c:import 
  /c:catch
  
  Using x:out select=$doc/./ allows for fetching of values of 
  elements / attributes as expected.  I have encountered a situation 
  where I would like to fetch and store the entire document 
 in a database.
  
  Trying x:out select$doc/ outputs the entire XML 
 document without 
  the element names, etc. (i.e. only the content within the 
 elements / 
  attributes).
  
  Any idea on what's the best way to achieve this?
 
 Some questions:
 Do you always want to store the entire doc or only under 
 certain conditions?
 

The page is built to respond to a certain operation, so always.

 How do you want to store the doc? For example, as a CLOB or 
 something else?

Quite simply as a text string (i.e. PostgreSQL text type).



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: dumping XML document

2007-01-04 Thread Kris Schneider

Kralidis,Tom [Burlington] wrote:

-Original Message-
From: Kris Schneider [mailto:[EMAIL PROTECTED] 
Sent: 03 January, 2007 10:40 AM

To: Tag Libraries Users List
Subject: Re: dumping XML document

Kralidis,Tom [Burlington] wrote:


Hi,

Using tomcat 6.0.0, I am using the following fragment to fetch a 
remote XML document:


c:catch var=caught
c:import url=${param.url} varReader=xmlSource
 x:parse var=doc xml=${xmlSource} scope=page /  


/c:import 


/c:catch

Using x:out select=$doc/./ allows for fetching of values of 
elements / attributes as expected.  I have encountered a situation 
where I would like to fetch and store the entire document 


in a database.

Trying x:out select$doc/ outputs the entire XML 


document without 

the element names, etc. (i.e. only the content within the 


elements / 


attributes).

Any idea on what's the best way to achieve this?


Some questions:
Do you always want to store the entire doc or only under 
certain conditions?





The page is built to respond to a certain operation, so always.


It seems like the simplest thing to do would be (ignoring exception handling):

c:import url=${param.url} var=doc/
%-- store ${doc} in database --%
x:parse doc=${doc} var=parsedDoc/

How do you want to store the doc? For example, as a CLOB or 
something else?



Quite simply as a text string (i.e. PostgreSQL text type).


For storing ${doc} in the database, you could use the JSTL SQL actions, but 
it might be better to just create your own tag to handle it.


--
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]