CDATA / html to xml
How do i take the content of an html file and put in in an
xml.
The part that's in the CDATA are now individual html files so
I want to
take
the content of that html file and put it in the CDATA. I'm
not sure if
that's the best way to do it though... might be better to
store the HTML in
the DB and then write it out from there???
<emailMessage>
<messagetype>Welcome</MessageTpye>
<Subject>Welcome</Subject>
<MessageContent>
<![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
<title>test</title>
</head>
<body>
welcome to our site<br /> you are blah blah<br
/><br />
<p>blah blah</p>
<table><tr><td>whatever</td></tr></table>
</body>
</html>
]]>
</MessageContent>
</emailMessage>
The part that's in the CDATA are now individual html files so
I want to
take
the content of that html file and put it in the CDATA. I'm
not sure if
that's the best way to do it though... might be better to
store the HTML in
the DB and then write it out from there???
Suggestions?
It is possible that your HTML, if it attempts to conform to
XHTML standard, could include a CDATA section and I don't think
you're permitted to nest a CDATA section inside another CDATA
section.
quote:
I'm not sure if that's the best way to do it though... might
be better to store the HTML in the DB and then write it out from
there???
It depends on your goal. If you're creating a content
management system using a database for storage is probably a better
option.
Similar Messages
-
Using CDATA in Script (XML)
Hello,
I'm trying to create an XML var using CDATA to get some htmlText.
Sample:
<fx:Script>
<![CDATA[
var newXML:XML = XML("<node><![CDATA["+ myRichTE.htmlText+" ]]></node>")
]]>
<fx:Script>
<mx:RichTextEditor id="myRichTE" />
But i get an error on this line. (give it a try, something about an unclosed tag, can't give the exact english error message since i got french UI)
It seems that you can't use
<![CDATA[xxxx]]>
in Script section of an Application (in addition of the main CDATA which contains all Script), since it interprets as a real CDATA.
And I think I can't do without it to store the htmlText inside an XML node.
Any ideas ?
(maybe by "escaping" the CDATA tag ?)
Thanks a lot.Indeed, actually, it is as simple as this :
<fx:Script>
<![CDATA[
myXMLnode = myRichTE.htmlText
]]>
<fx:Script>
<mx:RichTextEditor id="myRichTE" />
It is correctly inserted into the XML, by replacing tags with their corresponding html entities. -
HTML and XML files open in same window(KM Navigation iView)
Hi All,
I have created a KM navigation which is pointing the folder inside the documents repository. This folder contains HTML and XML files. It is rendering fine. But, when I click on the file links in KM Navigation iView, it is opening in new window.Here I need to open in same window. How can I acheive this?. Please help me.
Thanks & Regards,
Venkatesh RHi ,
check the below thread and try options mentioned in it
https://www.sdn.sap.com/irj/sdn/thread?threadID=72594
Koti Reddy -
Export pdf to html/txt/xml
Hi,
I downloaded "adobe acrobat x pro" for trying the "save as"/export functionality to xml/htm/text etc. and the result was exactly what I was looking for in terms of output, keeping formatting etc.
However, I am building an application which need to have an embeded library in order to do pdf to html/txt/xml conversion on the fly keeping formatting.
I have tried a number of libraries for pdf to html/txt/xml conversion an none of them deliver anything near what adobe acrobat x pro does in terms om keeping format/tables etc.
So, my question is how can I get access to the "save as"/export functionality in adobe acrobat x pro in any official adobe library, sdk, service, product etc. since I assume acrobat x pro does not expose any api for convert functionality or may be used serverside?
Best regards,
RickIt sounds like you want to use Acrobat as a web service. Rather than pursue this route, you may want to note that such a use of Acrobat is not permitted under the license. Thus it may not worth pursuing. Why convert to HTML is a possible question anyway, at least on a regular basis? On occasions I can understand the need.
For programmable features you should probably check in the SDK forum. -
HTML to XML Conversion ?
Developed a content presentation java servlet implmenting xmlparser2.jar classes, works well. We're storing content (in XML) format as blob, then using parser we are able to do the transformation of the xml file to HTML for presentation.
stream = null;
String result = null;
URL URLStream = new URL(xmlIn);
ByteArrayOutputStream xbaos = new ByteArrayOutputStream();
if(mStylesheet.startsWith("http"))
stream = getURLInputStream(mStylesheet);
else
stream = new FileInputStream(mStylesheet);
XSLProcessor processor = new XSLProcessor();
DOMParser parser = new DOMParser();
parser.setValidationMode(false);
parser.setPreserveWhitespace(true);
parser.parse(in);
xdoc = parser.getDocument();
XSLStylesheet xss = new XSLStylesheet(stream, URLStream);
processor.processXSL(xss, xdoc, xbaos);
result = xbaos.toString();
parser.reset();
return result; -- HTML conversion
We are evaluating using xslt to convert the XML to a form based medium for content maintenance. Wondering if once a XML document is parsed to HTML (DOM) can it be parsed back to XML for subsequent update to stored value in blob column. Specifically interested in conversion (parser) from HTML to XML
Simply can HTML (in DOM format validated against a xsd) be transformed back to XML ?Do you know of a method in the xdk that takes a well formed HTML doc and using xsd / xslt convert back to original xml spec?
Because you created (and as long as you create) the HTML from XML it will be well formed (every tag will be ended with an end-tag) and you can therefore transform it back into XML.
Most times it will not be possible to convert HTML found on the 'internet' into XML because this HTML is not well formed. For example, many people forget to end a paragraph of text within HTML with the </p> tag.
We are evaluating using xslt to convert the XML to a form based medium for content maintenance. Wondering if once a XML document is parsed to HTML (DOM) can it be parsed back to XML for subsequent update to stored value in blob column. Specifically interested in conversion (parser) from HTML to XML
Simply can HTML (in DOM format validated against a xsd) be transformed back to XML ? -
please who knows where one can download a java HTML-to-XML converter class where all that is needed is to supply any http link and it will output XML to the outputstream or whatever
thanksYou must realize that there is no possible way all valid HTML can be made into valid (well-formed) XML - right?
html can have over lapping tags (not real tags here, but you'll see):
<tag1>
<tag2>
<tag1>
<tag2>
That's valid html, but totally invalid xml (xml doesn't let you overlap tags).
If you're using XHTML, then your html is already xml.
If you're going from XML to HTML, then you can use XSTL; but it won't work in the other direction. -
BPELConsole: Initiate does not show HTML or XML form to fill in variables
Hi,
i am using a xsd with a cascaded import of other xsds.
If i use one import layer everything is fine.
But if i use something like:
1.xsd (imports 2.xsd)
2.xsd (imports 3.xsd)
The BPELConsole refuses to show me a HTML or XML form where i can fill in the variables...Hi,
For time being create one dummy process with request and response as a string type and call your process with the [xml]string input by creating partnerlink.
Generate xml from the schema with xml generator tools.
or use java api to invoke the process.
Regards,
Bogi -
hello everybody im just a novce here very new to jsp and xml. Could someone teach how to make html to xml. Actually html is to display mysql data but I want it on xml could somebn\ody help here is the code this is a jsp file.
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.Date" %>
<%
Connection conn = null;
Statement stmt = null;
ResultSet rset = null;
String SQLCOM = "";
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn=DriverManager.getConnection("jdbc:mysql://localhost/test1");
stmt = conn.createStatement();
%>
<html>
<body>
<hr>
<%
SQLCOM = "select "+
"id_ctry, "+
"name "+
"from countries "+
"order by name ";
rset = stmt.executeQuery(SQLCOM);
while( rset.next() ) { %>
<%= rset.getString("id_ctry") %>,
<%= rset.getString("name") %><br>
<% }
conn.close();
%>
<hr>
</body>
</html>Hello ABAP_SAP_ABAP ,
Youneed to select the option "generate template data " and then on the displaying template there you will see the option for editing in the top left corner toolbar.
Then after editing you can do a XMl syntax check and test your proxy.
Hope this helps.
Thanks,
Greetson -
Converting PDF Files to Html or Xml
how can i tranfrom the pdf file to html or xml using Acrobat's API? The software already have the function(http://tv.adobe.com/watch/learn-acrobat-x/converting-pdf-files-to-other-file-formats/). In C# ,I can use the acrobat's dll open the pdf file and can invoke the MenuItem SaveAs;
like this:
AcroApp.Show();
AcroAVDoc.Open(@"D:\xpdf\a.pdf","aaaa");
AcroApp.MenuItemExecute("SaveAs");
AcroApp.CloseAllDocs();
AcroApp.Exit();
But this is not automatic.Try the forum for Acrobat SDK.
-
I know I can parse XML into some HTML, but is there any tools or methods existed to parse HTML into XML?
I have a not well-formed HTML with a lot data fields, including a lot not closed tags. This HTML is generated by some XML(as I can see), but I can't find a way to reform it into a XML, and eventually stored the data into another database.
Anyone can help me? I appreciate!
KIBAs SAm has told you, you can use jTidy, for the purpose, a sample code , which can convert an html file to xml file is given at following url:
see the documentation as well.
http://sourceforge.net/docman/display_doc.php?docid=1298&group_id=13153
gaurav_k1 -
How do I generate HTML from XML & XSL using XSL Processor ?
I want to generate a HTML from XML & XSL using XDK for C on
linux-8i.
I run the XSLSample well.
But it only generate a XML from a XML & a XSL.
Can any one give me some advise or sample code?Just use HTML tags instead of xml tags in your stylesheet, and
you'll generate HTML instead.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="ROWSET">
<table border="1" cellspacing="0">
<xsl:for-each select="ROW">
<tr>
<td><xsl:value-of select="EMPNO"/></td>
<td><xsl:value-of select="ENAME"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet> -
Read datas from HTML or XML file in LabView
Hi all,
I need help in the following. I need to read the measurement results from test report into LabView. Test report format is HTML or XML. Please give me some advice on how to do this?
Thank you.
MikA quick search through the forums will point you to this thread which has some excellent advice and a effecient parser vi
Jeff -
Embedding HTML in XML CDATA and encoding issues
Hi all,
I'm embedding HTML code in a CDATA section. My problem is that, depending on the document, the HTML can be encoded in many formats. I borrowed a piece of code that sniffs that format so i can create String in the "right" encoding (or at least the one that was guessed).
- If I directly injected those in the CDATA section, i guess they'd be encoded in UTF-8 and some character would be misinterpreted?
- What if i would transcode the HTML from the sniffed format to utf-8?
-Are there any issues woth doing this?
Sorry if this is a dumb question but I'm quite new to that kind of encoding issues.
BTW i'm using DOM.
Thanks
lexoI don't know if it's a dumb question. I just don't understand it at all. Encoding issues only arise when you write data from a Java program to an external location, or when you read data from an external location into a Java program. And none of the activities you mentioned there have anything to do with that.
When you write your XML to an external file, or wherever you write it to, it gets encoded at that moment. The whole thing. Elements, attributes, CDATA sections, the whole thing. Doesn't matter what's in it, the whole thing gets encoded in whatever charset was chosen.
Does that help? -
Flash Player 10 removes HTML encoding in CDATA when parsing XML
I have an application that was written with Flash Professional 8/AS2 and it parses XML for rendering dynamic media content. The XML pulls text with HTML markup out of CDATA sections and places them into an html enabled text field. Everything has worked wonderfully until Flash Player 10.
Now, if we use html escape characters for greater than or less than symbols, they are being decoded by the xml parser.
Here's my example CDATA section:
Here <u>we</u> go: This <node> <works>
when I grab its value using nodeValue or toString, the results are different from Flash Player 9 to 10. Here's what I'm getting:
node.nodeValue (Flash Player 9):
Here <u>we</u> go: This <node> <works>
node.nodeValue (Flash Player 10):
Here <u>we</u> go: This <node> <works>
node.toString (Flash Player 9):
Here <u>we</u> go: This <node> <works>
node.toString (Flash Player 10):
Here <u>we</u> go: This <node> <works>
In Flash 10, if I escape the ampersand, it will work, but this doesn't work in 9. for example, the following works in 10:
<![CDATA[Here <u>we</u> go: This &#60;node&#62; &lt;works&gt;]]>
This all happens before I assign it to a text field. How do I keep the parser from destroying my escaped characters in Flash 10? Do I just need to drop support for Flash Player 9 and go for what works in 10, or is there a solution for both?
Message was edited by: XygarI'm not an action script programmer. I'm just trying to fix some code written like 3 years ago. So I think I am wrong about where this problem is coming from.
The original developer actually set up a class to load a remote xml file via sendAndLoad on a LoadVars object. It passes an object with an onData delegate set that passes the event object to an xml parsing method.
the parsing method looks like this:
private function parseXml(eventObj:Object){
if(eventObj != undefined)
try
//ExternalInterface.call("logMessage", eventObj.toString());
_xmlDoc.parseXML(eventObj.toString());
_xmlDoc.loaded = true;
_xmlDoc.onLoad(true);
catch(ex)
_xmlDoc.onLoad(false);
else
_xmlDoc.onLoad(false);
I added the ExternalInterface call so that I could log the stuff out in javascript (since I'm not sure how to debug this app).
_xmlDoc is defined as: private var _xmlDoc:XML;
The eventObj receives the xml string and then passes it to the parseXML thing. Here's the odd part. In Flash Player 10, if I comment out my ExternalInterface call, the xml string has the escaped character decoded before it gets to the parser.
However, if I uncomment my ExternalInterface call, it logs the escaped strings as i would expect, but the parser gets the correct formatting this time! Suddenly it all works.
I really wish I had an AS2 programmer on campus still.... -
Newbie, Please help, How do I add CDATA to exsting xml flash asset
Hi, I am a front end web designer/developer and
analyst...struggling with putting an accordian flash xml menu
together. I have it done except I need to add a simple trademark
symbol circle with r. I am struggling with how to do this since I
am not savvy in actioncript. I assume the best way is to add it is
with a CDATA child node, but do not know how or whatever is the
best way to get this done since am on a tight deadline. I need
someone to explain step by step what I have to do to get this
simple addition resolved. Attached are the links to home page and
code for the xml file. The left navigation is the asset that I need
to add the trademark symbol under about, about ADHERE. Thanks so
much in advance!!!!!!
[URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index
page with flash xml menu asset[/URL]
xml code:
<?xml version="1.0" encoding="UTF-8"?>
<accodion>
<item name="HOME">
</item>
<item name="ABOUT">
<item name= "ABOUT
ADHERE<![CDATA[write]]>"></item>
<item name="Medical Information" url="
http://www.jnj.com?ref=Random">
</item>
<item name="About SCIOS" url="
http://www.jnj.com?ref=Random">
</item>
</item>
<item name="INTERACTIVE DOSING INFORMATION">
<item name="Indications and Usage" url="
http://www.jnj.com?ref=Random"></item>
<item name="Contraindications" url="
http://www.jnj.com?ref=Random"></item>
<item name="Warnings" url="
http://www.jnj.com?ref=Random"></item>
<item name="Dosage and Administration" url="
http://www.jnj.com?ref=Random"></item>
</item>
<item name="RESOURCES AND TOOLS">
<item name="NATRECOR PI" url="
http://www.jnj.com?ref=Random"></item>
<item name="About Heart Failure" url="
http://www.jnj.com?ref=Random"></item>
<item name="Stages of Heart Failure" url="
http://www.jnj.com?ref=Random"></item>
<item name="NATRECOR Dosing Information" url="
http://www.jnj.com?ref=Random"></item>
<item name="Patient Management Resources" url="
http://www.jnj.com?ref=Random"></item>
</item>
<item name="US PRESCRIBING INFORMATION">
</item>
<item name="IMPORTANT SAFETY INFORMATION
ref=http://www.jnj.com">
</item>
<item name="REGISTRATION ref=http://www.jnj.com">
</item>
</accodion>
FLASH actionscript is as follows:
// The accordion
var accordion = this
// The item list
var itemList = []
// SETTINGS
//-------------PROPERTIES----------------
// Separation between the buttons
var separation = 1.5
// Tabulation between the buttons and the margin
var tabulation = 10
// if true, it cant be more than one items opened at the same
time (only for the first buttons, POWERFUL, MENU ,ACCORDION, ets).
var autoClose = true
// if true, it cant be more than one subItems opened at the
same time.
var subItemAutoClose = true
// if true, open and close all the subItems at the same time.
var openAll = false
// The height of the button
var itemHeight = 21
// The width of the button
var itemWidth = 230
// If true, show the light over the button
var light = true
// The ease of the menu opening
var openEase = 2.5
// The ease of the menu closing
var closeEase = 2.5
// The rollOut color fade speed
var rollOutFade = 8
//-------------COLORS----------------
// The color of the button
var buttonColor = 0xa
// The roll over color
var rollOverColor = 0xCCCCCC
// The arrow color
var arrowColor = 0xCCCCCC
// The arrow color on roll over
var rollOverArrowColor = 0x000000
// The text color
var TextColor = 0xFFFFFF
// The text color on roll over
var rollOverText = 0x000000
// LOADING XML
// The xml data
var xmlSource:XML = new XML
// Loading the xml
xmlSource.onLoad = function(success:Boolean):Void {
// When the load finishs...
if (success) {
// The first node of the xml
xmlRoot = xmlSource.firstChild
// The item nodes
xmlItems = xmlRoot.childNodes
// The total of items
total = xmlItems.length
// Creating the buttons
for (i=0; i<total; i++){
// Attaching the buttons
accordion.attachMovie("item", "item" + i, i)
// The button reference
itemList
= accordion["item"+i]
// The first node of the item node
itemList.xmlRoot = xmlItems
// The separation between subitems
itemList.separation = separation
// Tabulation between the subitems and the margin
itemList
.tabulation = tabulation
// subItems auto close
itemList.subItemAutoClose = subItemAutoClose
// The subitems height
itemList
.itemHeight = itemHeight
// The subitems width
itemList.itemWidth = itemWidth
// shows/hides the subitems light
itemList
.light = light
// The subitems color
itemList.buttonColor = buttonColor
// The roll over color
itemList
.rollOverColor = rollOverColor
// The arrow color
itemList.arrowColor = arrowColor
// the arrow color on roll over
itemList
.rollOverArrowColor = rollOverArrowColor
// The text color
itemList.TextColor = TextColor
// The roll over text color
itemList
.rollOverText = rollOverText
// the opening easing
itemList.openEase = openEase
// The closing easing
itemList
.closeEase = closeEase
// The roll over fade speed
itemList.rollOutFade = rollOutFade
// open all
itemList
.openAll = openAll
// ignore white
xmlSource.ignoreWhite = true;
// Loads the .xml file
xmlSource.load("accordion.xml");
// Aligning the items each one below the other
this.onEnterFrame=function(){
// Does the align to ALL the items
for (i=1; i<total; i++){
// Aligning the items
itemList._y = itemList[i-1]._y +
itemList[i-1].mask._height + itemList[i-1].button._height +
separation
// The cursor position
cursor._x = _xmouse
cursor._y = _ymouse
// Opens the items
onMouseDown = function (){
// Does this to all the buttons
for (i=0; i<total; i++){
// If is clicked
if (itemList
.button.hitTest(cursor)){
// Shows the current item
showCurrent(itemList)
// Shows the button clicked
showCurrent=function(current){
// Does this to all the buttons
for (i=0; i<total; i++){
// Does this to all the buttons exept the clicked
if (itemList
!=current){
// Close the other items if autoclose = true
if (autoClose){
// Close the other items
itemList.openBox=false
// fades the roll over effect of the other items
itemList
.over = false
//Does this to the clcked item only
} else {
// If it has sub items
if (total>0){
//Hides them if its open
if (itemList.openBox){
itemList
.openBox=false
//Shows them if its closed
} else {
itemList.openBox=true
// If it has no subitems goes to the link
} else {
getURL(xmlRoot.attributes.url, _self)Please don't cross-post in multiple forums. I have answered
this in your other thread.
Maybe you are looking for
-
I'm having a problem with audio in iTunes 10
Hello there, During playback with iTunes 10.5 beta 8, i have somes artifacts. Beacaus eit's difficult to describe, I've made a quick recording you can get there: http://cl.ly/2K270t3G2G111T2e3j33 Every tracks are perfectly played by quicktime or VLC.
-
How do I change my email address when sending a PDF file:
How do I change my email address (correct it) when sending a PDF file?
-
Compiling packages with libapr in it, strange link errors
On my Solaris 10 boxen, suddenly I cannot build stuff anymore that utilizes Apache's apr. This includes Apache 2 (2.0.53 and 2.0.54), and subversion. The funny thing is, I did build 2.0.53 a few weeks ago, and did not bump into the problem. Rebuildin
-
Update query in sql taking more time
Hi I am running an update query which takeing more time any help to run this fast. update arm538e_tmp t set t.qtr5 =(select (sum(nvl(m.net_sales_value,0))/1000) from mnthly_sales_actvty m where m.vndr#=t.vndr# and m.cust_type_cd=t.cust_type and m.cus
-
Nokia n95 maps licence problem and gps not working
hi i have n95 and i formated it all and it's mass memory, now when i open maps i don't find my license, also i can't update it, i can't dowload maps for my phone, so i can't navigate without internet, also gps lock not working and when i use pc suit