File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes HTML content for a Markup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "HTML content for a Markup" Watch "HTML content for a Markup" New topic
Author

HTML content for a Markup

Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
I want to create a structured document in which the i have a mark up <DATA></DATA> which can contain html tags & any other charecters
eg
<DATA>
User Information
<tale>
<tr>
<td>ID</td>
<td>NAME</td>
</tr>
</table>
</DATA>
.So how can i specify this element in the DTD
[This message has been edited by Anoop Krishnan (edited July 02, 2001).]


I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
You should treat even the HTML tags like any other "normal" XML tags. They are no exceptions.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
Thank you for your reply
But i have seen something like this related to xml.What is this actually
<![CDATA[<greeting>Hello, world!</greeting>]]>
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Marking the entire section as CDATA instructs the parser not to process the elements enclosed as XML data, but to treat them as raw data. If the text contains any XML tags, they too are treated as plain text. Often times authors use this trick to prevent some parts of the documents from being processed.
HTH
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
Glen Tippetts
Greenhorn

Joined: Jun 14, 2001
Posts: 10
I hope this is still on topic and relevent to the question at hand:
How do I translate an XML tag to HTML where the tag is a valid XML tag that can be queried with XPATH, but the data within the tag may contain special characters that need to be passed through to the HTML so that the HREF functions properly.
For example:
<url>http://www.brainbench.com/xml/bb/common/testcenter/subcatresults.xml?cat1=9&cat2=31&cat3=22</url>

------------------
IBM Certified Developer - XML and Related Technologies, V1.
AcqURL : The next evolution in bookmark management.


IBM Certified Developer - XML and Related Technologies, V1.<BR><A HREF="http://www.acqurl.com" TARGET=_blank rel="nofollow">AcqURL</A> : The next evolution in bookmark management.
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Glen, you can construct your HTML output using {XPath expression}, which is shorthand from <xsl:value-of select="XPath expression">
xml:
<?xml version="1.0"?>
<url>http://www.brainbench.com/xml/bb/common/testcenter/subcatresults.xml?cat1=9&amp;cat2=31&amp;cat3=22
</url>
xslt:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<a href="{url}">this is a link</a>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
output:
<html>
<body>
<a href="http://www.brainbench.com/xml/bb/common/testcenter/subcatresults.xml?cat1=9&cat2=31&cat3=22%0A">this is a link</a>
</body>
</html>

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Glen Tippetts
Greenhorn

Joined: Jun 14, 2001
Posts: 10
The URL inside the tags contains special "&" characters, so the parser chokes on them.
However, I found that if I put the <![CDATA[http://www.brainbench.com/xml/bb/common/testcenter/subcatresults.xml?cat1=9&cat2=31&cat3=22]]> tag inside of the <url> </url> tags everything works fine.
The first time I tried this it didn't work, so there must have been a typo in the code I was using to programatically insert the <![CDATA[var]]> in the XML document I was creating.
Everything is working fine now.
 
 
subject: HTML content for a Markup