• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

editing xml files through jsp webapp

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm hoping somebody can point me in the right direction.

I have am xml file that I need a client to edit, I want to write a jsp page that they can fill in fields and delete info etc on the original xml file...

i'm disturbed and perplexed aswhere to start, can somebody please help me.#

kind regrads
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote a web based xml editing application for a client, the following suggestions occur to me.

1. Don't think "jsp" - all the work will be done elsewhere in JavaBeans or similiar helper classes. JSP formatting of pages will be trival in comparison to other problems.

2. Start by learning how to read a XML document in, modify it and write it out.

3. Characters that have special significance in XML and HTML - < & ' " etc may require special handling. Java regex library is your friend in handling this sort of thing.

Bill
 
Philllip Brown
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bill,

Thanks for pointers... i'm on the long open road now!

Phil
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by William Brogden:


3. Characters that have special significance in XML and HTML - < & ' " etc may require special handling. Java regex library is your friend in handling this sort of thing.

Bill



Hi Bill,

things are going smoothly. I notice whe I edit an XML file with text in quotation marks, an error occurs. that is to say, an irrecoverable error occurs for the end-user/html client.

ok so if I use &-q-u-o-t-; etc it is all good, however, the human race are nefariously untrustworthy, and, if anything I couldonly trustthem to actually put REAL quotation marks in.

could youplease advise mea little in what I should be doing.

your original answer to my original question was a little terse, however I am a resourceful character and it was enough to get me on the way. however, it would be greatly appreciated if you could be more eloborate in further instances.

Thank you once again and I do hope you have time to spare to point this troubled cowboy west, to the promised land.


"Oh cold blue norther wind, Won�t you forgive me of my sins, I want to go back out West, To the cowboy�s promised land" Kevin McGehee
 
Sheriff
Posts: 28346
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't trust the users to do anything right with respect to XML. But normally you shouldn't have to escape quotes in text nodes. So if you're having a problem (unfortunately you didn't say what it was) then perhaps people are pasting those so-called smart quotes from MS Word and your web application is not encoding them properly.
 
PhilipM Brown
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Yes Indeed the ap is handling it fine and is being written to xml file.

Through your cunning, I have tracked down the problem to the xsl file that displays it.

I receive:
XML Parsing Error: not well-formed

<album description=""hi"" id="Lant...

any thoghts with the xsl?

thanks
 
Paul Clapham
Sheriff
Posts: 28346
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not a text node. That's an attribute, and you DO have to escape quotes in attributes that are delimited by quotes.
 
PhilipM Brown
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul, Thanks...

i'm starting to do some research on java regexp now...

I suppose it's just a matter of finding the offending expressions "& etc... and changing to "& etc.

I messed around with regexp in php a little so i should figure it out, however if you have any pointers....

kind regards
 
PhilipM Brown
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI All,

I've got my webapp running real good now, even uploading images and resizing, then ammending newfile changes to xml file....

however I have to refresh folders in eclipse everytime for the image to show in the web browser?

can anybody comment.

thanks
 
PhilipM Brown
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it seems to be a default setting in eclipse: auto refresh project is not set as default
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic