Search Results

Search found 58802 results on 2353 pages for 'system xml'.

Page 40/2353 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Help Modifying Generic REST Helper PHP Example Code to Support XML DOM

    - by Jennifer Baker
    Hi! I found this example PHP source code at HTTP POST from PHP, without cURL I need some help modifying the example PHP source to support XML DOM for manipulating a REST API. I thought that if I update the CASE statement for the XML section below from $r = simplexml_load_string($res); to $r = new DOMDocument(); $r->load($res); that it would work but it doesn't. :( Any help would be appreciated. function rest_helper($url, $params = null, $verb = 'GET', $format = 'xml') { $cparams = array( 'http' => array( 'method' => $verb, 'ignore_errors' => true ) ); if ($params !== null) { $params = http_build_query($params); if ($verb == 'POST') { $cparams['http']['content'] = $params; } else { $url .= '?' . $params; } } $context = stream_context_create($cparams); $fp = fopen($url, 'rb', false, $context); if (!$fp) { $res = false; } else { // If you're trying to troubleshoot problems, try uncommenting the // next two lines; it will show you the HTTP response headers across // all the redirects: // $meta = stream_get_meta_data($fp); // var_dump($meta['wrapper_data']); $res = stream_get_contents($fp); } if ($res === false) { throw new Exception("$verb $url failed: $php_errormsg"); } switch ($format) { case 'json': $r = json_decode($res); if ($r === null) { throw new Exception("failed to decode $res as json"); } return $r; case 'xml': $r = simplexml_load_string($res); if ($r === null) { throw new Exception("failed to decode $res as xml"); } return $r; } return $res; }

    Read the article

  • populate textboxs with xml node attributes

    - by Doug
    I have Data.xml: <?xml version="1.0" encoding="utf-8" ?> <data> <album> <slide title="Autum Leaves" description="Leaves from the fall of 1986" source="images/Autumn Leaves.jpg" thumbnail="images/Autumn Leaves_thumb.jpg" /> <slide title="Creek" description="Creek in Alaska" source="images/Creek.jpg" thumbnail="images/Creek_thumb.jpg" /> </album> </data> I'd like to be able to edit the attributes of each Slide node via GridView (that has a "Select" column added.) And so far I have: protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { int selectedIndex = GridView1.SelectedIndex; LoadXmlData(selectedIndex); } private void LoadXmlData(int selectedIndex) { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(MapPath(@"..\photo_gallery\Data.xml")); XmlNodeList nodelist = xmldoc.DocumentElement.ChildNodes; XmlNode xmlnode = nodelist.Item(selectedIndex); titleTextBox.Text = xmlnode.Attributes["title"].InnerText; descriptionTextBox.Text = xmlnode.Attributes["description"].InnerText; sourceTextBox.Text = xmlnode.Attributes["source"].InnerText; thumbTextBox.Text = xmlnode.Attributes["thumbnail"].InnerText; The code for LoadXmlData is just a guess on my part - I'm new to working with xml in this way. I'd like have the user to slected the row from the gridview, then populate a set of text boxes with each slide attributed for updating back to the Data.xml file. The error I'm getting is "Object reference not set to an instance of an object" at the line: titleTextBox.Text = xmlnode.Attributes["@title"].InnerText; - so I'm not reaching the attribute "title" of the slide node. Thanks for any ideas you may have.

    Read the article

  • can't insert xml dml expression as a string

    - by 81967
    Here is the code below that would explain you the problem... I create a table below with an xml column and declare a variable, initialize it and Insert the Value into the xml column, create table CustomerInfo (XmlConfigInfo xml) declare @StrTemp nvarchar(2000) set @StrTemp = '<Test></Test>' insert into [CustomerInfo](XmlConfigInfo) values (@StrTemp) Then comes the part of the question,, if I write this... update [CustomerInfo] set XmlConfigInfo.modify('insert <Info></Info> into (//Test)[1]') -- Works Fine!!! but when I try this, set @StrTemp = 'insert <Info></Info> into (//Test)[1]' update [CustomerInfo] set XmlConfigInfo.modify(@StrTemp) -- Doesn't Work!!! and throws an error The argument 1 of the xml data type method "modify" must be a string literal. is there a way around for this one? I tried this, but it is not working :(

    Read the article

  • main.out.xml error

    - by husainsn
    Hello I installed Eclipse and Android ADT. When I create android project and try to run, I get following on main.out.xml file: This document is empty. Right click here to insert content However, main.xml file has xml data for layout. Please help what I need to do after right clicking. Thanks

    Read the article

  • Spec. for JUnit XML Output

    - by Gilad Naor
    Where can I find the specification of JUnit's XML output. My goal is to write a UnitTest++ XML reporter which produced JUnit like output. See: "Unable to get hudson to parse JUnit test output XML" and "http://stackoverflow.com/questions/411218/hudson-c-and-unittest"

    Read the article

  • Filtering most out of XML with XSL?

    - by Gnudiff
    I need to transform a lot of XML files (Fedora export) into a different kind of XML. Trying to do it with XSL stylesheets and checking with the msxsl transformer. Supposedly I have xml file like this (assuming there are actually other nodes inside AAA, OBJ, amd all other nodes), Source.XML: <DOC> <AAA> <STUFF>example</STUFF> <OBJ> <OBJVERS id="A1" CREATED="2008-02-18T13:28:08.245Z"/> <OBJVERS id="A2" CREATED="2008-02-19T10:42:41.965Z"/> <OBJVERS id="A13" CREATED="2009-03-16T12:43:11.703Z"/> </OBJ> </AAA> <FFF/> <GGG/> <DDD> <FILE /> </DDD> </DOC> Which I need to look something like this (Target.XML): <MYOBJ> <ELEM>contents of OBJVERS with the biggest id OR creation date (whichever is easier to do) go here</ELEM> <IMAGE> contents of <FILE> node go here</IMAGE> </MYOBJ> The main problem that I have is that since I am new to XSL (and for this particular task do not have enough time to learn it properly) is that I can't understand how to tell XSL processor not to process anything else, I keep getting output from , for example. Update: basically, I solved this problem meanwhile. I will post my own answer and close the question. Update2: OK, Andrew's answer works, too, so I am just accepting it. :)

    Read the article

  • Read XML with PHP

    - by sea_1987
    I am trying to check a field in some XML that is returned from an outside. The XML is returned in a variable call $out and when you view the source of the page you get a XML output of the following, <?xml version="1.0" encoding="UTF-8"?> <ResponseBlock Live="FALSE" Version="3.51"> <Response Type="AUTH"> <OperationResponse> <TransactionReference>23-9-1334895</TransactionReference> <TransactionCompletedTimestamp>2010-04-30 15:59:05</TransactionCompletedTimestamp> <AuthCode>AUTH CODE:TEST</AuthCode> <TransactionVerifier>AlaUOS1MOnN/iwc5s2WPDm5ggrCLwesUnHs9h+W0N3CRaln2W6lh+6dtaRFFhLdwfnw6y7lRemyJUYl9a3dpWfzORE6DaZkFMb+dIb0Ne1UxjFEJkrEtjzx/i8KSayrIBrT/yGZOoOT42EZ9loc+UkdGk/pqYvj8bZztvgBNo2Ak=</TransactionVerifier> <Result>1</Result> <SettleStatus>0</SettleStatus> <SecurityResponseSecurityCode>1</SecurityResponseSecurityCode> <SecurityResponsePostCode>1</SecurityResponsePostCode> <SecurityResponseAddress>1</SecurityResponseAddress> </OperationResponse> <Order> <OrderInformation>This is a test order</OrderInformation> <OrderReference>Order0001</OrderReference> </Order> </Response> </ResponseBlock> I want check what value is in the 'Result' field. I am unsure how to access the information using PHP, so far I have, $xml = simplexml_load_string($out); Many Thanks

    Read the article

  • change extension obfuscate XML file contents

    - by FFish
    I have SlideShowPro, a Flash photo app that loads an XML file with the paths to the images. Now I don't want people to go sniff in the XML file to get to the images. I tried changing the file images.xml to spacer.gif and it seems to work fine. But I would like to know if I would run into any problems changing the extension. btw already used a few techniques to make the images not so accessible, I know there is no bulletproof solution. Obfuscating the XML file is just another trick..

    Read the article

  • xml file reading

    - by Dilse Naaz
    How to read an xml file in silverlight using webclient. I have one task, in this the xml file that i stored in my machine will read and the content od the xml file will display on a data grid. how it will be done?

    Read the article

  • Sum value of XML attributes using PowerShell 2.0

    - by Yooakim
    I have a directory with XML files. I quickly want to go through them and sum upp the value stored in one attribute. I have figured out how to fidn the nodes I am interested in. For example: (Select-Xml -Path .\*.xml -XPath "//*[@Attribue = 'valueImlookingfor']").Count This command gives me the count of elements in all of the XML files in the current directory which has the value "valueImlookingfor" in the "Attribue". I want to sum up all the values of the "Attribute", not count them. What would be the best way to do this in PowerShell? I am new to PowerShell so this may be trivial but un-known to me... All tips are much appreciated :-)

    Read the article

  • Sencha Tocuh XML Reader Problem

    - by Ploetzeneder
    Hi, i am student and cannot afford the premium support, so my question here: I have quite a simple XML and it gives me the following Error: http://img33.imageshack.us/i/screenprn.png/ Ext.regModel('User', { fields: ['id', 'name', 'email'] }); var store = new Ext.data.Store({ model: 'User', autoLoad:true, proxy: { type: 'ajax', url : 'ajax/user.xml', reader: { type : 'xml', model: 'User', record: 'user' } } });

    Read the article

  • Java XML Output - proper indenting for child items

    - by Dr1Ku
    Hello, I'd like to serialize some simple data model into xml, I've been using the standard java.org.w3c -related code (see below), the indentation is better than no "OutputKeys.INDENT", yet there is one little thing that remains - proper indentation for child elements. I know that this has been asked before on stackoverflow , yet that configuration did not work for me, this is the code I'm using : DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.newDocument(); doc = addItemsToDocument(doc); // The addItemsToDocument method adds childElements to the document. TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute("indent-number", new Integer(4)); // switching to setAttribute("indent-number", 4); doesn't help Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(outFile); // outFile is a regular File outFile = new File("some/path/foo.xml"); transformer.transform(source, result); The output produced is : <?xml version="1.0" encoding="UTF-8" standalone="no"?> <stuffcontainer> <stuff description="something" duration="240" title="abc"> <otherstuff /> </stuff> </stuffcontainer> Whereas I would want it (for more clarity) like : <?xml version="1.0" encoding="UTF-8" standalone="no"?> <stuffcontainer> <stuff description="something" duration="240" title="abc"> <otherstuff /> </stuff> </stuffcontainer> I was just wondering if there is a way of doing this, make it properly indented for the child elements. Thank you in advance ! Happy Easter coding :-) !

    Read the article

  • Libraries/Solutions for using XSL to create interactive web forms from XML

    - by Brabster
    This seems like a pretty straightforward thing to do, but I can't find anything off the open-source shelf. Is there a solution already out there that does the following: can be configured with an arbitrary XSL stylesheet generates a web form based on an arbitrary XML document and the XSL creates edit functionality in appropriate places in the rendered form updates the local representation of the XML document provides capabilities to view, save the new XML document Ideally, one that plugs into a Java web application. Even better if it can generate the XSL based on schema documents - but that might not be feasible, not really thought it through. For context, I'm thinking things like pleasant-for-humans editing of Maven POMs, ANT build.xml, etc. Cheers,

    Read the article

  • How to read an XML file with Java?

    - by Yatendra Goel
    I don't need to read complex XML files. I just want to read the following configuration file with a simplest XML reader <config> <db-host>localhost</db-host> <db-port>3306</db-port> <db-username>root</db-username> <db-password>root</db-password> <db-name>cash</db-name> </config> How to read the above XML file with a XML reader through Java?

    Read the article

  • array data taking XML value is not taking css value in as3

    - by Sagar S. Ranpise
    I have xml structure all data comes here inside CDATA I am using css file in it to format text and classes are mentioned in xml Below is the code which shows data but does not format with CSS. Thanks in advance! var myXML:XML = new XML(); var myURLLoader:URLLoader = new URLLoader(); var myURLRequest:URLRequest = new URLRequest("test.xml"); myURLLoader.load(myURLRequest); //////////////For CSS/////////////// var myCSS:StyleSheet = new StyleSheet(); var myCSSURLLoader:URLLoader = new URLLoader(); var myCSSURLRequest:URLRequest = new URLRequest("test.css"); myCSSURLLoader.load(myCSSURLRequest); myCSSURLLoader.addEventListener(Event.COMPLETE,processXML); var i:int; var textHeight:int = 0; var textPadding:int = 10; var txtName:TextField = new TextField(); var myMov:MovieClip = new MovieClip(); var myMovGroup:MovieClip = new MovieClip(); var myArray:Array = new Array(); function processXML(e:Event):void { myXML = new XML(myURLLoader.data); trace(myXML.person.length()); var total:int = myXML.person.length(); trace("total" + total); for(i=0; i<total; i++) { myArray.push({name: myXML.person[i].name.toString()}); trace(myArray[i].name); } processCSS(); } function processCSS():void { myCSS.parseCSS(myCSSURLLoader.data); for(i=0; i<myXML.person.length(); i++) { myMov.addChild(textConvertion(myArray[i].name)); myMov.y = textHeight; textHeight += myMov.height + textPadding; trace("Text: "+myXML.person[i].name); myMovGroup.addChild(myMov); } this.addChild(myMovGroup); } function textConvertion(textConverted:String) { var tc:TextField = new TextField(); tc.htmlText = textConverted; tc.multiline = true; tc.wordWrap = true; tc.autoSize = TextFieldAutoSize.LEFT; tc.selectable = true; tc.y = textHeight; textHeight += tc.height + textPadding; tc.styleSheet = myCSS; return tc; }

    Read the article

  • xml pahsing issue..

    - by 3gwebtrain
    HI, any one help me in this xml parsing issue? my xml is : name my jquery is : $(function(){ $.get("shop.xml", function(data){ var shopInfo = $(data).find("shop").attr('title'); var showowner = $(data).find("raj").attr('title'); alert(shopInfo+':'+showowner); }) }) when i alret in firefox it alret the shopInfo as "null" and showowner "title" and i case if i check with ie, and chrome, i am getting "null:null" in the alert message. any one tell me what is the wrong i am doing here? i need my jquery need to get xml data properly from to all browsers, for that any suggestion please?

    Read the article

  • Rails - strip xml import from whitespace and line break

    - by val_to_many
    Hey folks, I am stuck with something quite simple but really annoying: I have an xml file with one node, where the content includes line breaks and whitspaces. Sadly I can't change the xml. <?xml version="1.0" encoding="utf-8" ?> <ProductFeed> ACME Ltd. Fooproduct Foo Root :: Bar Category I get to the node and can read from it without trouble: url = "http://feeds.somefeed/feed.xml.gz" @source = open((url), :http_basic_authentication=>["USER", "PW"]) @gz = Zlib::GzipReader.new(@source) @result = @gz.read @doc = Nokogiri::XML(@result) @doc.xpath("/ProductFeed/Vendors/Vendor").each do |manuf| vendor = manuf.css("Name").first.text manuf.xpath("//child::Product").each do |product| product_name = product.css("Name").text foocat = product.css("Category").text puts "#{vendor} ---- #{product_name} ---- #{foocat} " end end This results in: ACME Ltd. ---- Fooproduct ---- Foo Root :: Bar Category Obviously there are line breaks and tab stops or spaces in the string returned by product.css("Category").text. Does anyone know how to strip the result from linebreaks and taps or spaces right here? Alternatively I could do that in the next step, where I do a find on 'foocat' like barcat = Category.find_by_foocat(foocat) Thanks for helping! Val

    Read the article

  • Declaring the datatype dynamically reading from an xml string

    - by NLV
    Hello I've this strange issue. I've an xml string which looks like below - <key><int>5</int></key><value><int>10</int> The above xml is obtained after serializing a Dictionary using Paul's Code. Now i want to convert the xml back to the dictionary. How can i get the type "int" from the xml and declare the dictionary as follows? Dictionary<int, int> Any clues?

    Read the article

  • Using Qt's XML library for simple operation

    - by David Powers
    I basically want to use the XML parser from Qt in my existing project. I have only used Qt once before, and that was with Qt Designer, and I am not having much luck finding anything on Google about how to just use the XML library. I have downloaded a web page that has one large list, and I want to parse it and add each list item to a c++ list. I found this sample code on Ubuntu forums... http://www.uluga.ubuntuforums.org/showpost.php?p=9112973&postcount=6 I want to use that except I need to know what exactly I need to add to the project to get access to it. One other small question is QDomDocument seems to be for files (makes sense) but I have the XML in a string. What part of the XML library works for contents of a string?

    Read the article

  • Organising XML results as cells in container (AS3)

    - by PJ Palomaki
    Hi, I'm having some problems figuring out how to organise data pulled off XML in cells within a container. I'm sure this should be a basic thing in AS3, but my head's fried.. can anyone help? Basically an array if fed to callThumbs() which iterates through it and compares the entries with preloaded XML _my_images. If match is found, it's sent to processXML which loads all relevant info and loads a .jpg thumbnail. All this is then fed to createCell which creates a specific cell with position values depending on x_counter and y_counter values (4 cells in a row) and adds the cell into a container _container_mc. The Problem: This all works fine and looks fine, the problem is that the cells within the container do not display in descending order. They are in random order, probably because some of the .jpg's takes longer to load etc. How do I easily organise the cells within the container in descending order by the XML .id value? Or how do I tell Flash to wait till the thumbnail and data is loaded and the cell created and added? Thanks guys, would really appreciate all the help! PJ //Flash (AS3) function callThumbs(_my_results:Array):void { // selector = 1 for specific items, 2 for search items var _thumb_url:XML; for (var r:Number=0; r < _my_results.length; r++) { // iterate through results vector, compare with _my_images XML .id for (var i:Number=0; i < _my_images.length(); i++) { if (_my_images[i][email protected]() == _my_results[r]) { _thumb_url=_my_images[i]; processXML(_thumb_url, i); } } } } // End callThumbs function processXML(imageXML:XML, num:Number) { // Processes XML data and loads .jpg thumbnail var _thumb_loader=new Loader(); _thumb_loader.load(new URLRequest("thumbs/thumb_sm/" + imageXML.@id + "_st.jpg")); _thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,thumbLoaded); _thumb_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, urlNotFound); var id:XMLList = new XMLList; id = imageXML.@id; var description:XMLList = new XMLList; description = imageXML.@description; function urlNotFound(event:IOErrorEvent):void { trace("The image URL '" + String(imageXML.@id) + "' was not found."); } function thumbLoaded(e:Event):void { var imageLoader:Loader = Loader(e.target.loader); var bm:Bitmap = Bitmap(imageLoader.content); createCell(bm, id, description, num); adjustFooterBar(); // Adjust bottom footer } } // End processXML private function createCell(_image:Bitmap, _id, _description:String, _position):void { // Creates a cell with data, add to container var _cell_mc = new CellTitle(); _cell_mc.initCell(_image, _id, _description, _position, x_counter, y_counter); if (x_counter+1 < 4) { x_counter++; } else { x_counter = 0; y_counter++; } _container_mc.addChild(_cell_mc); // movieclip container } // End createCell

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >