Is it possible to convert HTML to XML in as2?

Hi,
I am trying to develop a stock widget to use in my mobile using flashlite 2.x.
I have chosen "http://charting.nasdaq.com" to obtain 5days chart /6months chart..
But I am not able to use XML object for this and parse.. The values are in table format.. So I have to use LoadVars.. but writing a AS2 code
to obtain values like High/Low price of the stock or volume is very lengthy since the data obtained are not in XML format..
i tried this
var example_xml:LoadVars = new LoadVars();
example.ignoreWhite = true;
example_xml.load("http://charting.nasdaq.com/ext/charts.dll?2-1-14-0-0-75-03NA000000www-&SF:4|5-WD=539-HT=39 5--XTBL-");
example_xml.onLoad = function(success) {
     if (success == true) {
          trace(example_xml);
Is it possible to convert them to xml and use relevent methods or xml properties?
If I use example_xml:XML = new XML() then tracing example_xml (as above) doesn't give any data
Any help?

I had a project a few years ago where I converted 10s of thousands of TestStand HTML files from TS 1.0 and 3.0.
Most of what I did is specific to our internal data structures, but I'll try to help get you started.
The general idea is to pick out the report header and data sections from each file, then eliminate the HTML formatting.
The attached file will extract the Report Header and data sections.
To use this, you will need to download this additional VI that I posted here in the regex board a few years ago.
http://forums.ni.com/t5/BreakPoint/Regular-Expressions-Board/m-p/1269088#M14343
Here is one more file that will parse out each data record and dtermine it's Name, status, type value, limits and duration/timestamp info
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness
Attachments:
Parse TestStand HTML.vi ‏42 KB
Parse TestStand HTML Data Section.vi ‏55 KB

Similar Messages

  • Converting HTML to XML

    Does any one know if there is a
    plug-in for HomeSite to convert HTML documents to XML
    documents? This would save alot instead of buying another program
    that does this. Because Adobe just finished a online tutorial on
    how to use AJAX which made it very easy. Now I need to switch my
    HTML docs to XML.
    PG

    In my previous post I have added a singleton tag img with the closing of it.
    Normally the tags which are singleton tags in HTML can beclosed by using /> at the ned of the tag
    Like following:
    <img src="abcd.gif" />
    <input type="button" />
    However, I agree with your point about Quotes. In HTML it is not mandatory to put quotes around a value.
    But if it is possible then you  can make it a habit to put quotes around all the HTML attribute values.
    [This is also a standard practice]

  • Convert "html to xml"

    Does anyone know if HomeSite or Dreamweaver has the ability
    to convert HTML documents to XML documents? This would save alot
    instead of buying another program that does this.
    PG

    does htmltidy do the conversion you need?
    homesite integrates with it, though htmltidy itself is open
    source.

  • How to convert HTML into XML

    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!
    KIB

    As 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

  • Is it possible to convert HTML to PDF without pagination?

    I have an HTML file that I'd like to convert to PDF. Ideally, I'd like the PDF to consist of one long page without being broken up into different pages. Is this at all possible?
    I also don't want to scale the image down too far as to make it unreadable. I've tried adjusting the page size settings, but the biggest page I can generate is a portrait-oriented tabloid (14 x 17) page, but it still prints to more than one page.
    If pagination can't be suppressed, does anyone know of any HTML/CSS code that I can use to break the pages in certain spots? If I'm forced to use a paged PDF, I at least don't want the articles within the page to break in the middle.
    I'm using Acrobat Pro XI on a MacBook Pro. Browser-wise, I have Firefox, Chrome and Safari installed, if opening the HTML file in one of them makes any difference.
    Thanks in advance, aj

    You can actually create a custom page size BUT you have to go through the Acrobat interface
    File>Create>PDF From Web Page...>
    In the Create PDF from Web Page window, put in the URL you want to capture
    In the Create PDF from Web Page window, click the Settings button
    in the Web Page Conversion Settings window click the Page Layout tab
    In the Size sections', Page Size pop-up menu select Custom
    In the Width field, set the size of the page width in inches
    in the Height field set the page height in inches
    In the Margins section, set you margins (Top, Bottom, Left, Right) in the appropriate fields in inches
    In the Orientation section set either Portrait or Landscape
    in the Scaling section set whether or not you want scale the page content
    in the Web Page Conversion Settings window click the OK button
    In the Create PDF from Web Page window click the Create button.

  • 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 ?

  • HTML to XML converter

    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
    thanks

    You 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.

  • Is it possible to convert PDF file into HTML

    Dear friends
    Is it possible to convert PDF file into HTML. I have few hundread PDF files i like to convert this files into HTML. I hope it can be done through Java but i don't know how to start this coding. anybody can give me a brief idea to go ahead.

    Why do you want to do this yourself? I quick search on Google showed several utilities to do this, some freeware, some commercial.

  • 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.

  • 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,
    Rick

    It 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.

  • Http-adapter: Convert html-post to JAVA-post?

    Hello everybody,
    unfortunately I am not a java programmer. But I am testing the http adapter.
    Is it possible to convert the following html-post into JAVA code?
    <html><head>
    <body>
    <form action="http://myserver" method="post">
    <p>Interface Namespace<br>
    <input name="namespace" value="http://mum.mappings" size="40"></p>
    <p>(Sender-) Service:<br>
    <input name="service" value="MUMHTTP" size="40"></p>
    <p>Interface Name:<br>
    <input name="interface" value="MI_Merge_1" size="40"></p>
    <p>Text:<br>
    <textarea name="Text" rows="5" cols="50"></textarea></p>
    <p><input type="submit" value="Send"></p>
    </form>
    </form>
    </body>
    </head>
    </html>
    For me it is important to send the values of the <input> values.
    How has the code look like?
    Many regards, mario

    Hi Mario,
    I Have once used this code snippet to send a payload to XI engine. Please change the parameters like XI server URL,
    Namespace,senderservice etc..
    Please let me know if you need any further help.
    Regards,
    Ananth
    public static void main(String[] args) throws Exception {
         try {
              URL sapURL = null;
              String urlString = "http://"+serverHost+":"+serverPort+"/sap/xi/adapter_plain?namespace="+senderNamespace+"&interface="
    +senderInterface+"&service="+senderservice+"&party=&agency=&scheme=&QOS="+QOS+"&sap-user="+sapUser+"&sap-password="+
    sapPWD+"&sap-client="+client+"&sap-language=E";
              sapURL= new URL(urlString);
              HttpURLConnection xi = (HttpURLConnection)sapURL.openConnection();
              xi.setRequestMethod("POST");
              xi.setRequestProperty("Content-Type","text/xml");
              xi.setDoOutput(true);
              generateXML(xi.getOutputStream());
              System.out.println(urlString);
              System.out.println("Resp Msg:"+xi.getResponseMessage()+" -- Resp Msg:"+xi.getResponseCode());
              xi= null;
         } catch (Exception e) {
                   e.printStackTrace();
    public static void generateXML(OutputStream out){
         try {
              PrintWriter prt = new PrintWriter(out,false);
              //Create XML tags
              prt.println("<?xml version= "1.0"?>");
              prt.print("<"+resp_MsgType+" xmlns:ns=""+resp_NameSpace+"">");
              prt.print("<"+xml_tag1+">");
              prt.print(xml_tagValue1);
              prt.print("</"+xml_tag1+">");
              prt.print("<"+xml_tag2+">");
              prt.print(xml_tagValue2);
              prt.print("</"+xml_tag2+">");
              prt.print("</"+resp_MsgType+">");
              prt.flush();
              prt.close();
              out.close();
              prt=null;
              out=null;
              }catch(Exception e){
                   e.printStackTrace();

  • Is it possible to convert .doc to pdf  ?

    Hi..
    I am very new to Livecycle Workflow...! I just want to know whether it is possible to convert .doc to pdf  ?
    Just by googling i came to know that CreatePDF2 Service will do this Conversion ! But it throws me an Exception like "Conversion Exception :" Cannot connect to Adobe Service "...!
    Can u guys pls help me out to slove the problem ?
    Thanks & Regards
    Karthik.

    you don't know the format of a word doc? well, that's good for you because it's a nightmare.
    - check POI (http://jakarta.apache.org/poi/index.html) to see if you can load-up the .doc then generate the .pdf with iText
    - personally i use the Open Office Bean to open the .doc, i save it in .sxw (OO format which is a jar of different XML files), then i use XSLT to transform content.xml in .fo then use FOP to build the PDF. sounds crazy but works fine (only on a machine with graphic support - not via Telnet, etc...)

  • Is it possible to convert text captions to Smart Shapes?

    Hello,
    I have a collegue that is using Cp 5 to record software simulations which then need to be brought into Cp6. The problem is that our standards (for software simulations) employ Smart Shape call outs (not the Cp 5.5 and earlier text captions).
    Is it possible to convert these text captions into our themed Smart Shapes either automatically inside Captivate 6 or by modifying the content within the CPTx file?
    Thank you,
    Shawn

    Hello Lilybiri,
    As always you are awesome! :-)
    >I don't believe an automatic switch will be possible, because smart shapes are totally different objects.
    I understand because there are a huge variety of shapes in either format. But I suspect that it should be easy to convert a text caption from any style to one specified smart shape style.
    Actually, I am asking before the simulations get started. So nothing has been done yet. I am unsure what you are suggesting I should do in the preferences under Cp 5.5. Are you suggesting that there is a way to convert 'some format' of text callouts, in a Cp5.5 demonstration simulation, to Smart Shapes in Cp6?
    >but since you already have created the simulations, it has to be done manually. Hoping for you that
    >someone has a bright idea, but I do not see one immediately.
    For anyone else in this situation, it would be handy to have a solution (rather than painstakingly convert each manually).
    I am wondering if this might be a relatively easy search/replace within one of the xml files within the CPTx file. I'm going to look at this tonight.
    Thanks for your assist.

  • Converting audio to xml form

    hi
    i need to know how to convert audio to xml form.. can any one help me on this...

    take a look at this article:
    http://www.javaworld.com/javaworld/javatips/jw-javatip117.html?tip

  • [Q] convert DOM to XML Document

    Hi,
    Is there any class or library which convert DOM to XML document?
    ----- java program ------------
    import org.w3c.dom.*;
    import org.apache.crimson.tree.XmlDocument;
    public class Sample {
      public static void main(String args[]) {
        // create a document and root element
        Document doc = new XmlDocument();
        Element root = doc.createElement("html");
        doc.appendChild(root);
        // append a data
        Element body = doc.createElement("body");
        root.appendChild(body);
        body.appendChild(doc.createTextNode("Hello"));
        // convert DOM to XML Document
    }----- expected result ----------
    <html>
    <body>
      Hello
    </body>
    </html>Could you help me?

    Hi,
    Look at the package javax.xml.transform
    or
    try the following code:
    I tried the following code.
    ----- java program ------------
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import java.io.OutputStream;
    public class Sample {
      public static void main(String[] args) {
        try {
          // create a document and root element
          Document doc = DocumentBuilderFactory.newInstance()
                                .newDocumentBuilder()
                                .newDocument();
          Element root = doc.createElement("html");
          doc.appendChild(root);
          // append a data
          Element body = doc.createElement("body");
          root.appendChild(body);
          body.appendChild(doc.createTextNode("Hello"));
          Element ul = doc.createElement("ul");
          String[] list = {"foo", "bar", "baz"};
          for (int i=0; i<list.length; i++) {
           Element li = doc.createElement("li");
           li.appendChild(doc.createTextNode(list));
         ul.appendChild(li);
    body.appendChild(ul);
    // convert DOM to XML Document
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer();
    //OutputStream stream = new FileOutputStream("output.xml");
    OutputStream stream = System.out;
    transformer.transform(new DOMSource(doc), new StreamResult(stream));
    } catch (Exception ex) {
         ex.printStackTrace();
    ----- result ------------
    <html>
    <body>Hello<ul>
    <li>foo</li>
    <li>bar</li>
    <li>baz</li>
    </ul>
    </body>
    </html>Great! Very thanks!

Maybe you are looking for

  • Delete multiple record in tabular with check box.

    Hello guys, I need your suggestion.. I have master detail block. (INSTRUCTOR and SECTION) At detail block, I add check box item (name: RB_SECTION_ID) with Database Item "No", and value when check :SECTION_ID (on the property). I make a button DELETE.

  • Embedding location information into EXIF

    Hi, I find the new localization view of Lightroom 4 internesting. I can see the images when browsing the map, and I can see that the city and coutry are indicated. Is there a way to get this information in the EXIF header ? This would remove the need

  • Project system: CJE2 tcode.. Add the field to selction screen

    Hi, GM ALL I would like to add the field to selection screen for a dynamic report one which is using in CJE2 T.CODE. I am trying to add the field through se36 [logical data base level] but its not helping. Need to add below field to selection-screen

  • Old Firefox new tab had a snazzy list of websites i chose, but I can't find that option again.

    Ok so it was just a nice looking background and had websites I chose displayed. It had icons for each website and i really want that back but I cant find anything about it. Can anyone help?

  • Can iTunes only read / play its own Data Discs?

    Correct me if I'm wrong -- but can iTunes only read / play Data Discs that it creates? I've made Data CDs and Data DVDs from iTunes and it can read them once they're mounted. But if I create a Data CD or DVD of the exact same files using Toast, iTune