Pulling XML info with URL

I'm messing around with parsing data from an XML. I'm trying to pull data form the WoW armory page (yes I'm an addict :). If you go to the page and select view source you can see the XML, however when I try using URL and a buffer to output the data to the console, I will get the HTML code. I'm not sure why this is happening therefore not sure what I need to try to get the actual XML data. My best guess is that it will only output the XML if i'm using the browser. When I looked this up I found info on how to do it with cold fusion and it was mentioned to try setting the User Agent to Firefox or IE. Not sure if this is done with java.
Here's the Code I'm using:
     URL wow = new URL("http://www.wowarmory.com/item-info.xml?i=12042");
     BufferedReader in = new BufferedReader(new InputStreamReader(wow.openStream()));
     StringBuffer xmlBuffer = new StringBuffer();
     String inputLine;
     inputLine = in.readLine();
     while(inputLine != null)
          System.out.println(inputLine);
          inputLine = in.readLine();
     }If anyone can give me a push in the right direction I'd appreciate it. Thanks!

your onRelease is going to be lost because it's defined for a
loadMovie target. either wait until loading is complete to define
your mouse handler or load into a child movieclip.

Similar Messages

  • Getting XML info with ABAP mapping

    Hi everyone.
    I'm near to finish my abap mapping demo. The problem is that i don't know how i can retrieve the values of a kind of node.
    I would like to retrieve this data into a internal table. I've done the output XML.
    How can i get that values from SOURCE parameter into an internal table?
    Regards.

    Hi!
    First of all you have a little bit of XML parsing to do using the SIXML package in ABAP (see example reports in same dev class).
    Then you can travers your "document" with methods like
    get_elements_by_tag_name or get_root_element.
    There are also 2 function modules to convert a document into an ABAP internal table.
    SDIXML_DATA_TO_DOM and SDIXML_DOM_TO_DATA.
    Regards
    Michael

  • CiscoIPPhoneExecute with URL query strings

    Has anyone successfully used the CiscoIPPhoneExecute xml object with URLs that contain query strings? Specifically, I'm wondering how to pass query string values that include spaces.
    I'm able to successfully execute a URL such as:
    http://<webaddress>/PushPage.asp?Field1=Value1&Field2=Value2
    However, when I try to execute a URL like:
    http://<webaddress>/PushPage.asp?Field1=Value with space&Field2=Value2
    The phone displays an error message that says "Not Available", and the url that is pushed never gets executed.
    I have tried representing spaces in the query string values using both the conventional "+" symbol, and I have also tried using "%20". Neither of these escape sequences seems to work.
    Thanks for any advice.
    -Mike

    Thanks for the response. As I stated above, I know that ampersand (&) must be escaped, and I am properly escaping that character in the XML packets. I'm not having any problems pushing URLs that contain ampersand.
    What I can't figure out is how to push URLs with *SPACES* included in the query string values. Please see the example URLs I posted in my original message, specifically the second URL. Again, I omitted the necessary ampersand escape sequence there for clarity.
    -Mike

  • How to Post XML Messages with SOAP Headers to a Trading Partner URL

    Hi All,
    Greeting to the Oracle B2B Community. We are currently working on how to post a Custom XML Message with SOAP Headers to a Trading Partner URL. I would really appreciate if anybody could provide me some inputs or links to some documentation on how to achieve the above requirement. The details are below:
    1. Our Internal Application generates a Flat File (PO Extract).
    2. The Extract then needs to be transformed to an XML Message. We are planning to use BPEL to do the transformation to XML Message.
    3. Once it is transformed to an XML message it needs to be posted to the Trading Partner URL as an HTTP Post and with SOAP Headers.
    We are planning to use B2B to do the posting but I am not sure on how to do the set-ups and what all parameter files in B2B needs to be updated in order to achieve the same. Also it is mandatory that we send SOAP Headers in the XML Message.
    Thanks In Advance for your help.
    Regards,
    Dibya

    Hello Dibya,
    As you are already doing the transformation from Flat file to XML in BPEL which is typically the capability of B2B, please use the Soap binding in BPEL to send the document to Trading partner.
    Rgds,Ramesh

  • Rss feed check - feedvalidator not giving .xml info

    I want to view the .xml info for my feed
    http://lawofattraction.podOmatic.com/rss2.xml
    I know it validates but I use podomatic to create my feed then change it so I can post it the way I want it on Itunes.
    Feedvalidator used to give you validate but also list the .xml so I could fiddle with the contents. My brain is fried right now - how do I view this code? Help! Karen

    Feedvalidator doesn't display the code if it can't find anything to criticize - take it as a compliment.
    Control-click on the URL you give for the feed, and choose 'Download linked file' or equivalent. When downloaded, drag it to the TextEdit icon. When you have modified it, save it with the same name, and TextEdit will ask you whether you want to add .txt to the end - decline the offer.
    However, though I'm not familiar with Podomatic, if it's an online service you may have problems changing the feed - they generally don't allow you access to it. Whether you can upload your changed file I don't know, nor whether there is in fact a way of getting into the Podomatic version of it.

  • Urgent ! XML Output with header, body, trailer

    Gurus,
    I am trying to use Report to output an xml file with header, body and trailer regions. However, I find that the tool does not allow me to create a header region with info like <report_date>, <report_name>, <report_desc> etc.
    Moreover, the tool is not flexible that in the group level, it always automatically fills in the outer tag for me even if I intentionally leave it blank.
    So, except using the XML file output function, is there any other way outputing XML file using the tool? Otherwise, I may need to hard code a program to do so!
    Thanks for your advice!
    Shoshi

    Hi
    Reports XML file is driven by your queries and groups therein. This means that the groups (and break groups) are represented in XML form.
    It is not driven by the layout. So your header region does not appear.
    What I suggest is that you need to create a report level formula column in the Data Model. The formula returns date, name and description etc. Since this is a part of Data Model now, it will appear in the XML output.
    Regards
    Sripathy

  • How to "use" a xml file with a script?

    Hey Guys!
    I use the normal Button with the send-option to send the xml file to an url.
    My question is how it's possible to work in a php-script with the xml data out of the formular?
    Thanks for help.
    LG
    Adrian

    Hi,
    I need to read a XML document with StringReade class.
    My aplication receives an absolute path but this
    doesn't work:
    StringReader oStringReader =
    new StringReader(c:\java\libros.xml);
    However it works with:
    StringReader oStringReader =
    new StringReader("<?xml version="1.0" e......");
    ie, with the whole document as a String, but I need
    to do it as the frist way.
    Thankstake a look at this link:
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html

  • Problems with reading XML files with ISO-8859-1 encoding

    Hi!
    I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
    Here's the code:
    import java.io.File;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.net.*;
    * @author gustav
    public class RSSDocument {
        /** Creates a new instance of RSSDocument */
        public RSSDocument(String inurl) {
            String url = new String(inurl);
            try{
                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = builder.parse(url);
                NodeList nodes = doc.getElementsByTagName("item");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Element element = (Element) nodes.item(i);
                    NodeList title = element.getElementsByTagName("title");
                    Element line = (Element) title.item(0);
                    System.out.println("Title: " + getCharacterDataFromElement(line));
                    NodeList des = element.getElementsByTagName("description");
                    line = (Element) des.item(0);
                    System.out.println("Des: " + getCharacterDataFromElement(line));
            } catch (Exception e) {
                e.printStackTrace();
        public String getCharacterDataFromElement(Element e) {
            Node child = e.getFirstChild();
            if (child instanceof CharacterData) {
                CharacterData cd = (CharacterData) child;
                return cd.getData();
            return "?";
    }And here's the error message:
    org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
        at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at getrss.RSSDocument.<init>(RSSDocument.java:25)
        at getrss.Main.main(Main.java:25)

    I read files from the web, but there is a XML tag
    with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
    Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
    In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s).

  • Still problems serializing xml-docs with xml-parser for java v2.0.2.7

    Hi !
    I'm using the Oracle XML Parser 2.0.2.7.0 and get some problems when serializing the XMLDocument.
    In one class (DOMOut) I parse a xml-file with the oracle.xml.parser.v2.DOMParser, then obtain the XMLDocument and write it to System.out
    In another class (DOMIn) I fetch the XMLDocument from System.in, search for a given Element and print it's TextValue (if existing) to System.out
    That is where the error occurs.
    I get the XMLDocument from System.in but the returning NodeList from doc.getElementsByTagName() is empty. [nl.getLength()==0] even if it shouldn't be.
    Look at this code and output:
    [DOMOut]
    DOMParser parser = new DOMParser();
    parser.parse(url);
    XMLDocument doc = (XMLDocument)parser.getDocument();
    ObjectOutputStream out = new ObjectOutputStream(System.out);
    out.writeObject(doc); out.flush();
    [DOMIn]
    ObjectInputStream in = new ObjectInputStream(System.in);
    XMLDocument doc = (XMLDocument)in.readObject();
    doc.print(System.out);
    NodeList nl = doc.getElementsByTagName("Name");
    System.out.println("Length of NodeList: "+nl.getLength());
    if (nl.getLength()==0)
    System.out.println(argv[0] + ": not in this document!");
    else {
    XMLNode node = (XMLNode) nl.item(nl.getLength()-1);
    System.out.println(node.getNodeName() + ": " + (node.getFirstChild()).getNodeValue());
    This is the relevant code.
    I javac both classes and then do this:
    java DOMOut xmltestfile.xml > xx
    java DOMIn Name < xx
    And get this as output:
    <?xml version = '1.0'?>
    <!DOCTYPE course [
    <!ELEMENT course (Name,Dept,Instructor,Student)>
    <!ELEMENT Name ((#PCDATA)*)*>
    <!ELEMENT Dept ((#PCDATA)*)*>
    <!ELEMENT Instructor (Name)>
    <!ELEMENT Student (Name)*>
    ]>
    <course>
    <Name>Calculus</Name>
    <Dept>Math</Dept>
    <Instructor>
    <Name>Jim Green</Name>
    </Instructor>
    <Student>
    <Name>Jack</Name>
    <Name>Mary</Name>
    <Name>Paul</Name>
    </Student>
    </course>
    Length of NodeList: 0
    Name: not in this document!
    Has anyone an idea?
    If I do all this stuff without serializing it works.
    If I do not search for argv[0], but the string "Name" it fails.
    If I do search for "*" it works fine!
    I'm very confused could anybody please help me a bit??
    Stefan.
    [[email protected]]

    The link has been fixed. You will go to the v2 download page
    now. Sorry for the inconvience.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Renilton Oliveira (guest) wrote:
    : I didn't find the file for version 2.0.0.0 as well.
    : Renilton
    : Andrei Filimonov (guest) wrote:
    : : I tried to download XML Parser for Java v2 it seems that
    only
    : v
    : : 1.0.1.4 is available. Could you please give an exact URL for
    : v2
    : : download?
    : : Andrei Filimonov
    : : Oracle XML Team wrote:
    : : : The Oracle XML v2 parser is now available for download
    here
    : as
    : : : an early beta release and is written in Java. It features
    : an
    : : : improved architecture over the Oracle XML v1 parser and
    has
    : : : shown better performance on small to large XML documents.
    : It
    : : : will also be able to format the XML document according to
    a
    : : : stylesheet, having integrated an XSLT processor.
    : : : Version 2 of the XML Parser for Java, besides
    incorporating
    : an
    : : : XSLT processor, has been re-architected from version 1.
    This
    : : has
    : : : resulted in a number of changes to the class names
    : especially
    : : : those that support Namespaces. See v2changes.txt and
    : the .diff
    : : : difference files in the sample directory.
    : : : Oracle XML Team
    : : : http://technet.oracle.com
    : : : Oracle Technology Network
    null

  • How to get & use xml data with jstl libraries? (URGENT PLZ)

    I am using jstl to get and use xml data
    I needs to perform operations on the parsed xml document with other libraries of jstl. How can i do that.
    I used Dom variable to parse my document as:
    <x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
    where my project.xml is:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <project>      <projectName>myProject</projectName> </project>
    I can dislay this value in html by
    <x:out select="$test/project/projectName"/>
    But I need a string value sotred in variable such as <c:set var="pname" value="???">
    HOW CAN I SET THIS VALUE IN CORE VARIABLE THAT IS, USING <c:set...> SO THAT IT CAN BE USED ANYWHERE IN JSP PAGE TO CONCATE RETURNED STRING IN OTHER STRING VARIABLES DEFINED BY CORE LIB?
    Jessy
    Message was edited by:
    jessy
    Message was edited by:
    jessy

    I believe that <c:set> should do that but i am facing problem in it. Look into this jsp scriptlet:
    1-<x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
    2-<x:set var="ds" select="$test/project/projectName"/>
    3-<x:out select="$ds"/> <br>
    4-<c:set var="tt" value="${ds}" />
    5-<c:out value="${tt}" />
    In line 3 variable ds returns: myProject
    In line 5 variable tt returns: [[projectName: null]]
    perhaps on line 4 ds is storing some array to tt and i am not calling correct array element. I tried many options but still could not find solution. Plz Plz do something urgent for me. Thanks
    Jessy
    Message was edited by:
    jessy

  • Explain about xml schema with example

    Hi,
    Kindly anybody explain about xml schema with example?
    With Regards,
    L.rajesh

    Maybe this is what you are looking for ??? If not give us more info...
    Re: How it work?

  • How to read and parse a remote XML file with Java

    Hi.
    Using J2SE v1.4.2, I'd like to read and parse a remote file:
    http://foo.com/file.xml
    Is it possible with Java? I'd be extremely grateful if someone could provide me any webpage showing a very simple code.
    Thank you very much.

    How about the following?
         import java.io.InputStream;
         import java.net.URL;
         import javax.xml.parsers.DocumentBuilder;
         import javax.xml.parsers.DocumentBuilderFactory;
         import org.w3c.dom.Document;
         public static void main(String[] args) throws Exception {
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              DocumentBuilder db = dbf.newDocumentBuilder();
              URL url = new URL("http://foo.com/file.xml");
              InputStream inputStream = url.openStream();
              Document document = db.parse(inputStream);
              inputStream.close();
         }-Blaise

  • Request with URL ending with "/" not routed through default servlet

    I have deployed a web application that has a controller servlet. This
    servlet is configured (via web.xml) to be the default servlet with a servlet
    mapping defined with url-pattern set to "/".
    Requests for URLs such as "my.host/my/path" are correctly routed to the
    controller servlet, whereas a request to "my.host/my/" is not - it causes a 404
    to be returned immediately by the container.
    Any help appreciated
    Peter

    There's not enough data in your post to answer the question directly. Posting an example URL would help a lot.
    The chances are that the problem lies in the URL - it might contain some characters that are not directly usable in the shell and are therefore getting munged when you use them in 'do shell script'. There are ways around this, but posting an example URL would go a long way to telling if that's the problem or not.
    It is also possible that the web site is configured to block specific user agents such as curl or wget (in a vain attempt to block automated downloads of the content) but, again, it's hard to say without knowing a specific URL.
    If this is the case, you could use curl's -A switch to specify a different 'User-Agent' and fake out the server. For example, to pretend you're using Safari, use something like:
    do shell script "curl -O -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.12+ (KHTML, like Gecko)' " & fullWeb
    (note the single quotes around the User-Agent string)

  • Got Tiger & pulled iCal info from Panther.....Help!

    When I pulled the info from my Panther backup files & put in iCal, it brought all my calendars with all the events back, but it changed the order & the colors. It doesn't seem like a big deal, but I have those colors as themes throughout other applications as well.
    I pasted in the iCal folder from Library>Application Support. How can I control which calendar is which color, etc? Thanks!

    Henry,
    Click on your selected calendar, then Click the Info button on the lower right side of the iCal Window, and the window which opens will allow you to change the color in the color window drop down menu which is located in the upper right hand corner of the Info Window.
    Just drag them to change the order.
    ;~)

  • Need help with url for mx:HTTPService

    I inherited a Flex project and I do not have much experience with Flex.
    I have a mxml file with a HTTPService defined where the url is defined as such
    <mx:HTTPService id="domainFetcher" contentType="application/xml" resultFormat="e4x"
            url="{XXX.xxxPrefix}queries.php" method="POST" result="domainResultHandler(event)">
            <mx:request xmlns=""><ListDomainTree/></mx:request>
        </mx:HTTPService>
    I cannot determine how {XXX.xxxPrefix} is defined. When I make changes on the target web location I do not see the changes. If I remove the {XXX.xxxPrefix} then I do.
    So, it looks like {XXX.xxxPrefix} is pointing to another location that I cannot determine.
    I hope someone can help me with how to find out how the value of {XXX.xxxPrefix} is getting set.
    Thanks

    Use network monitor(it is a feature in Flash builder) to determine the url, also, XXX.xxPrefix? is it a property of the class where this httpservice is defined? I still do not understand what you mean by the following line.. Use debugger to find out whats in the prefix thing. Still your question does not have clarity, may be you should post more code.
    I inherited a Flex project and I do not have much experience with Flex.

Maybe you are looking for

  • Error while saving project in cProjects

    Hello, I am getting following error while saving a project in cProjects- Access via 'NULL' object reference not possible. Details of the error are given below- Can somebody please help me resolve this error? Thanks and regards, Milind Dumbre Error an

  • Need code for BDC

    Hello   Can anyone give me the code to upload data into 'KSU1' transaction( create cycle) through the function module 'KGAL_CREATE_CYCLE'. Regards Kiran

  • Formulas and Rounding

    Two things here that I've found problematic. -How can I set cells to display the formulas I have typed into them, rather than the formula outcome? -My Numbers is rounding 5s down, not up? Is this An American thing or a fault in Numbers? Anyone got an

  • Adding Fonts Changed Web Fonts

    I added my fonts through Fontbook and when I opened up Firefox all the fonts were some strange font. I thought it was just firefox, but I openned up safari and it was the same strange font. I want it to return to the original default font, but I can'

  • Presets for inserting images

    Hello all! Formerly, when I inserted images using the tab Homesite used width, height and alt attributes. Now, he omits width and height. Also in the folder list Homesite always starts with gif-images and I have to select jpg-files first. At home I a