Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Convert JSP to valid XML

Posted on 2001-08-02
8
Medium Priority
?
1,035 Views
Last Modified: 2013-11-19
Does anyone know a good (preferrably free) tool to convert a JSP file to valid XML format?
I've tried Tidy, but this tool can convert HTML to XML or XHTML but not JSP to XML. It will check first if my JSP file is valid HTML, which it is not (because there are a lot of JSP tags included, which will result in valid HTML, but which are not initially).

Thanks.
0
Comment
Question by:thomasphlips
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 6

Accepted Solution

by:
Wayne Bradney earned 268 total points
ID: 6345782
thomasphilips,

Tidy has an option: --input-xml
Have you tried that?

Regards,
WMB
0
 
LVL 1

Author Comment

by:thomasphlips
ID: 6345814
Yes I did, problem is that the input is JSP, not XML. The output should be XML. If I use the --input-xml Tidy ignores a lot of my JSP code.
0
 
LVL 6

Expert Comment

by:Wayne Bradney
ID: 6345847
thomasphilips,

Hmmn, that's a pain. I just recently took a look at Tidy for the first time and on further testing it seems you can do one or the other but not both (i.e you can use --input-xml to tidy up (already well-formed??) XML, or you can tidy up (malformed) HTML, but not both at the same time.

Sounds like Tidy needs a mode to ignore that fact that there may be non-HTML (but XML-like) markup in there, and just normalize it. (That's what I assumed input-xml would do -- else what's the point of a tidy-tool that expects well-formed input?).

I'm not aware of any other tool that does this kind of stuff.

Sorry I couldn't help out,
WMB
0
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 
LVL 4

Expert Comment

by:edmund_mitchell
ID: 6350267
It's a no-go.  There is no way to make something like:

<%= new java.Util.Date() %>

into valid xml.  The only thing you could do is hide it from the parser - write a custom pre-parser that puts the JSP code into comment delimiters:

<!-- <%= new javaCode() %> -->

Then you're good to go, XML syntax-wise, assuming that your HTML is well-formed XHTML, etc, etc.

You'd think someone has already written this class, but I've never heard of it.

HTH

Edmund
0
 
LVL 27

Expert Comment

by:BigRat
ID: 6351335
JSP into an XML based Content Management System perhaps? As Edmund says embedded script is very problamatic. ASP/JSP is very good for getting started but long term is fraught with maintainance problems.
   What you might consider is re-authoring with SmartTags (a la Jakarta Project) which not only effectively removes the script (and puts it in a maintainable area) but makes the resultnat HTML very XML conformant.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6789979
It's time to clean up this topic area and that means taking care of this question. Your options at this point are:

1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.

2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

3.  Ask Community Support to help split points between participating experts.  Just comment here with details.

4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.

PLEASE DO NOT AWARD THE POINTS TO ME.
____________________________________________
---------->  Hi Experts:

In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.

------------->  The ALL TOPICS link has been updated today to reflect all the new TAs.

Thank you everyone.

Moondancer :)
Community Support Moderator @ Experts Exchange
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6946865
<review>

<recommendation>
split between BigRat, wbradney and edmund_mitchell
</recommendation>

<objection>
any objection should be raised within 7 days
</objection>

<reviewer>
b1xml2
</reviewer>

</review>
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6948192
Thanks, Brandon.

Points have been split, awaiting comments here:
Points for BigRat -> http://experts-exchange.com/jsp/qShow.jsp?qid=20290550
Points for edmund_mitchell -> http://experts-exchange.com/jsp/qShow.jsp?qid=20290551

Moondancer - EE Moderator
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question