Search Results

Search found 15718 results on 629 pages for 'xml'.

Page 23/629 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Adding a block of XML as child of a SimpleXMLElement object

    - by miCRoSCoPiC_eaRthLinG
    Hey all, I have this SimpleXMLElement object with a XML setup similar to the following... $xml <<< EOX <books> <book> <name>ABCD</name> </book> </books> EOX; $sx = new SimpleXMLElement( $xml ); Now I have a class named Book that contains info. about each book. The same class can also spit out the book info. in XML format akin the the above (the nested block).. example, $book = new Book( 'EFGH' ); $book->genXML(); ... will generate <book> <name>EFGH</name> </book> Now I'm trying to figure out a way by which I can use this generated XML block and append as a child of so that now it looks like... for example.. // Non-existent member method. For illustration purposes only. $sx->addXMLChild( $book->genXML() ); ...XML tree now looks like: <books> <book> <name>ABCD</name> </book> <book> <name>EFGH</name> </book> </books> From what documentation I have read on SimpleXMLElement, addChild() won't get this done for you as it doesn't support XML data as tag value. Any ideas on how I should go about this ? Thanks, m^e

    Read the article

  • Add TOC to PDF from XML/JSON/file?

    - by Elias
    I currently have a PDF file without any ToC (for example, in Mac's Preview.app, I can't see the ToC in the sidebar). But I have the TOC in XML format, where there is a title and a pagenumber where that section starts. Is there any way I can add that TOC to my PDF file in a batch way? Since I have the TOC in XML, I can basically parse it in any possible way, so if there were a command line to add an TOC item to a PDF, I could also do that. Any ideas?

    Read the article

  • XML and HTML = need help using HTML code

    - by whitstone86
    I'm converting my static HTML site to a dynamic PHP/XML-driven one. This is my current code: <div class="divider"></div> <div class="main" style="width: 552px;"> <div class="time">00:00</div> <div class="show"><h3><b>Radio Show</b></h3> <p>Description</p></div> <div class="footer"></div> </div> and my XML file: <?xml version="1.0"?> <show> <showdesc> <divider1></divider1> <divmain></divmain> <airtime></airtime> <presenter></presenter> <showinfo></showinfo> <divfooter></divfooter> </showdesc> which is the above HTML, that I'm trying to get into the XML file. I don't know how to get it to get the info in, I can display a simple XML page, as suggested here: http://www.kirupa.com/web/xml_php_parse_intermediate.htm but I am trying to in PHP get this to display what's in the XML pages or display this output: "Sorry. No schedule page is available" if the XML is blank, as above. Anyone able to help me fix this? I've tried and tried but it's baffling me... Thanks.

    Read the article

  • How to process XML sernt via POST?

    - by John Conde
    I'm receiving XML sent via POST. Naturally I need to parse this XML to get at the goodies it holds for me. However, when I receive the XML is seems that PHP is parsing it like a query string. For example, this xml: <?xml version="1.0" encoding="utf-8"?> <ForgotPassword> <version>1.0</version> <authentication> <login>myresllerid</login> <apikey>1234567890abcdef</apikey> </authentication> <parameters> <emailAddress>[email protected]</emailAddress> </parameters> </ForgotPassword> Becomes this (from print_r($_REQUEST)): Array ( [ <?xml_version] => "1.0" encoding="utf-8"?> <IDCForgotPassword> <version>1.0</version> <authentication> <login>myresllerid</login> <apikey>1234567890abcdef</apikey> </authentication> <parameters> <emailAddress>[email protected]</emailAddress> </parameters> </IDCForgotPassword> ) You can see the XML is being broken up at the first equals sign (=) in the XML into a key/value pair. How do I avoid this?

    Read the article

  • Flash AS3 loading XML into listbox

    - by Anne
    I am able to load my XML file into flash and trace results. Want to populate listbox with information from xml file. Structure of xml file: <eBorders> <item> <thumb>borderTh/blank_th.jpg</thumb> <file>border/blank.jpg</file> </item> <item> <thumb>borderTh/border1_th.jpg</thumb> <file>border/border1.jpg</file> </item> </eBorders> AS3 code: var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("xml/borders.xml")); var dp:DataProvider = new DataProvider("borders.xml"); border_lb.dataProvider = dp; border_lb.iconField = "iconSource"; border_lb.rowHeight = 45; function processXML(e:Event):void { myXML = new XML(e.target.data); for(var i:int=0;i<myXML.*.length(); i++){ dp.addItem({iconSource:myXML.item.thumb.[i]}); } } Code is producing error I can't find. Thank you in advance for any help you might offer. Annie

    Read the article

  • How does one restrict xml with an XML Schema?

    - by John
    Hello, I want to restrict xml with a schema to a specific set. I read this tutorial http://www.w3schools.com/schema/schema_facets.asp This seems to be what I want. So, I'm using Qt to validate this xml <car>BMW</car> Here is the pertinent source code. QXmlSchema schema; schema.load( QUrl("file:///workspace/QtExamples/ValidateXSD/car.xsd") ); if ( schema.isValid() ) { QXmlSchemaValidator validator( schema ); if ( validator.validate( QUrl("file:///workspace/QtExamples/ValidateXSD/car.xml") ) ) { qDebug() << "instance is valid"; } else { qDebug() << "instance is invalid"; } } else { qDebug() << "schema is invalid"; } I expected the xml to match the schema definition. Unexpectedly, QxmlSchemaValidator complains. Error XSDError in file:///workspace/QtExamples/ValidateXSD/car.xml, at line 1, column 5: Content of element car does not match its type definition: String content is not listed in the enumeration facet.. instance is invalid I suspect this is a braino. How does one restrict xml with an XML Schema? Thanks for your time and consideration. Sincerely, -john Here is the xsd from the tutorial. <xs:element name="car"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Audi"/> <xs:enumeration value="Golf"/> <xs:enumeration value="BMW"/> </xs:restriction> </xs:simpleType> </xs:element>

    Read the article

  • .NET XML serialization gotchas?

    - by kurious
    I've run into a few gotchas when doing C# XML serialization that I thought I'd share: You can't serialize items that are read-only (like KeyValuePairs) You can't serialize a generic dictionary. Instead, try this wrapper class (from http://weblogs.asp.net/pwelter34/archive/2006/05/03/444961.aspx): using System; using System.Collections.Generic; using System.Text; using System.Xml.Serialization; [XmlRoot("dictionary")] public class SerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IXmlSerializable { public System.Xml.Schema.XmlSchema GetSchema() { return null; } public void ReadXml(System.Xml.XmlReader reader) { XmlSerializer keySerializer = new XmlSerializer(typeof(TKey)); XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue)); bool wasEmpty = reader.IsEmptyElement; reader.Read(); if (wasEmpty) return; while (reader.NodeType != System.Xml.XmlNodeType.EndElement) { reader.ReadStartElement("item"); reader.ReadStartElement("key"); TKey key = (TKey)keySerializer.Deserialize(reader); reader.ReadEndElement(); reader.ReadStartElement("value"); TValue value = (TValue)valueSerializer.Deserialize(reader); reader.ReadEndElement(); this.Add(key, value); reader.ReadEndElement(); reader.MoveToContent(); } reader.ReadEndElement(); } public void WriteXml(System.Xml.XmlWriter writer) { XmlSerializer keySerializer = new XmlSerializer(typeof(TKey)); XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue)); foreach (TKey key in this.Keys) { writer.WriteStartElement("item"); writer.WriteStartElement("key"); keySerializer.Serialize(writer, key); writer.WriteEndElement(); writer.WriteStartElement("value"); TValue value = this[key]; valueSerializer.Serialize(writer, value); writer.WriteEndElement(); writer.WriteEndElement(); } } } Any other XML gotchas out there?

    Read the article

  • XML Decryption Bug (referencing issue)

    - by OrangePekoe
    Hi, Needing some explanation of what exactly the decryption is doing, in addition to some help on solving the problem. Currently, when a portion of XML is encrypted, and then decrypted, the DOM appears to work correctly. We can see the element is encrypted and then see it return back once it is decrypted. Our problem lies when a user tries to change data in that same element after decryption has occurred. When a user changes some settings, data in the XML should change. However, if the user attempts to change an XML element that has been decrypted the changes are not reflected in the DOM. We have a reference pointer to the XML element that is used to bind the element to an object. If you encrypt the node and then decrypt it, the reference pointer now points to a valid orphaned XML element that is no longer part of the DOM. After decryption, there will be 2 copies of the XML element. One in the DOM as expected (though will not reflect new changes), and one orphaned element in memory that is still referenced by our pointer. The orphaned element is valid (reflects new changes). We can see that this orphaned element is owned by the DOM, but when we try to return its parent, it returns null. The question is: Where did this orphaned xml element come from? And how can we get it to correctly append (replace old data) to the DOM? The code resembles: public static void Decrypt(XmlDocument Doc, SymmetricAlgorithm Alg) { if (Doc == null) throw new ArgumentNullException("Doc"); if (Alg == null) throw new ArgumentNullException("Alg"); XmlElement encryptedElement = Doc.GetElementsByTagName("EncryptedData")[0] as XmlElement; if (encryptedElement == null) { throw new XmlException("The EncryptedData element was not found."); } EncryptedData edElement = new EncryptedData(); edElement.LoadXml(encryptedElement); EncryptedXml exml = new EncryptedXml(); byte[] rgbOutput = exml.DecryptData(edElement, Alg); exml.ReplaceData(encryptedElement, rgbOutput); }

    Read the article

  • XML jquery shortcuts

    - by Llamabomber
    I am writing a bit of code that appends my site nav with and extra ul that gives a description about where that link takes you. I need to use our CMS's built in Nav structure so appending via jQuery was the best solution, and XML makes the data easier to manage. My question is this: is there a more efficient way to write out the js? What I have so far is this: $(document).ready(function() { $.ajax({ type: "GET", url: "/js/sitenav.xml", dataType: "xml", success: function parseXml(xml) { // WORK $(xml).find("CaseStudies").each(function() { $("li#case_studies").append('<ul><li>' + $(this).find("NavImage").text() + $(this).find("NavHeader").text() + $(this).find("NavDescription").text() + $(this).find("NavLink").text() + "</li></ul>"); }); }; }); }); and the xml structure resembles this: <SiteNav> <Work> <CaseStudies> <NavImage></NavImage> <NavHeader></NavHeader> <NavDescription></NavDescription> <NavLink></NavLink> </CaseStudies> </Work> </SiteNav> I'm happy with my xml structure, but is there a more compact/efficient method of writing out the code for the jqeury? Every li in the nav has a unique id as well in case that helps...

    Read the article

  • How to save XML file before update?

    - by Robert Iagar
    Right so I have a simple app that consists of a calendar a Set Event button and list box that populates using a DataTemplate in WPF. When I build the app the Events.xml file is like this: <?xml version="1.0" encoding="utf-8" ?> <events> </events> I add events to xml through code. Final structure of the xml file is the following <?xml version="1.0" encoding="utf-8" ?> <events> <event Name="Some Name"> <startDate>20.03.2010</startDate> <endDate>29.03.2010</endDate> </event> </event> Now here's my problem. If I update the app and deploy it with Click Once and the app updates it self, I lose the list because the new file is empty. Any workaround this? Here's how I add the Data: var xDocument = XDocument.Load(@"Data\Events.xml"); xDocument.Root.Add(new XElement("event", new XAttribute("name", event.Name), new XElement("startDate", startDate), new XElement("endDate", endDate) ) ); xDocument.Save(@"Data\Events.xml");

    Read the article

  • Is there any diff tool for XML files?

    - by qedi
    Are there any good (Linux) tools for diffing two XML files? Ideally, I would like to be able configure it to some things strict, or loosen some things, like whitespace, or attribute order. I'll often care that the files are functionally the same, but diff by itself, would be annoying to use, especially if the XML file doesn't have a lot of linebreaks. For example, the following should really be okay to me: <tag att1="one" att2="two"> content </tag> <tag att2="two" att1="one"> content </tag>

    Read the article

  • XML file does't load when HTML5 video plays

    - by DD77
    I should be able to loads the related XML file and displays the content of the XML file as the video plays back. What am I missing? DEMO JAVSCRIPT // properties var XML_PATH = "http://www.adjustyourset.tv/interview/cuepoints.xml"; var video_width; var video_height; var videos_array=new Array(); // init the application function init() { // call loadXML function loadXML(); } // XML loading function loadXML() { $.ajax({ type: "GET", url: XML_PATH, dataType: "xml", success: function onXMLloaded(xml) { // set cuepoints find("cuepoints"); find("cuepoints"); // loop for each cuepoint $(xml).find('cuepoint').each(function loopingItems(value) { // create an object var obj={timeStamp:$(this).find("timeStamp").text(), desc:$(this).find("desc").text(), thumbLink:$(this).find("thumbLink").text(), price:$(this).find("price").text()}; videos_array.push(obj); // append <ul> and timeStamp $("#mycustomscroll").append('<ul>'); $("#mycustomscroll").append('<a><li id="item">Time Stamp:'+obj.timeStamp+'</li></a>'); }); // close </ul> $("#mycustomscroll").append('</ul>'); // append li tags $("#leftcolumn").append('<li src="'+videos_array[0].desc+'"> <p src="'+videos_array[0].thumbLink+'" /></li>'); // append description $("#price").append(videos_array[0].price); // call addListeners function addListeners(); } }); }

    Read the article

  • Syncronizing XML file with MySQL database

    - by Fred K
    My company uses an internal management software for storing products. They want to transpose all the products in a MySql database so they can do available their products on the company website. Notice: they will continue to use their own internal software. This software can exports all the products in various file format (including XML). The syncronization not have to be in real time, they are satisfied to syncronize the MySql database once a day (late night). Also, each product in their software has one or more images, then I have to do available also the images on the website. Here is an example of an XML export: <?xml version="1.0" encoding="UTF-8"?> <export_management userid="78643"> <product id="1234"> <version>100</version> <insert_date>2013-12-12 00:00:00</insert_date> <warrenty>true</warrenty> <price>139,00</price> <model> <code>324234345</code> <model>Notredame</model> <color>red</color> <size>XL</size> </model> <internal> <color>green</color> <size>S</size> </internal> <options> <s_option>some option</standard_option> <s_option>some option</standard_option> <extra_option>some option</extra> <extra_option>some option</extra> </options> <images> <image> <small>1234_0.jpg</small> </image> <image> <small>1234_1.jpg</small> </image> </images> </product> </export_management> Some ideas for how can I do it? Or if you have better ideas to do that.

    Read the article

  • Context.Items.Add on an XML return type?

    - by Scott Schluer
    So I have the following code contained within an HttpModule in an application I've been asked to support: app.Context.Response.ContentType = "text/xml"; app.Context.Items.Add("IpixRoomId", ipixRoomId); app.Context.Items.Add("IpixId", ipixId); app.Context.Response.Cache.SetCacheability(HttpCacheability.NoCache); app.Context.RewritePath(rewriteUrl, true); What's the purpose of adding data to Context.Items when the content type is XML? EDIT: For clarification, I'm calling up this URL: http://website.com/virtualtour/1971/6284/panorama2flash.swf I assume the SWF file (I know very little about Flash) makes another call to http://website.com/virtualtour/config.xml. The code I pasted above only executes on calls to config.xml. So since it's only the SWF file and config.xml being requested from the server, I'm a little confused. Can the .SWF file have access to HttpContext.Current.Items? Other than the HttpModule, there is no .NET involved in the code, it's a straight request to the SWF file which triggers a call to config.xml but it seems that those Context.Items contain the data needed to make the SWF file display the right virtual tour. I'm just missing where that link happens. It can't happen in the XML, so maybe in Flash?

    Read the article

  • Is starting to use CDATA a breaking change?

    - by kicsit
    For interaction with a customer's application we use XML documents. That is, we send an XML over HTTP and receive a response XML document the same way. The customer specified two XML schemata that describe the format of both the request and reply. All was working fine, until one day the customer started to use CDATA sections in the response XML. We set up our parser unmindful of CDATA sections, so we failed to interpret them. My question is: Who made a mistake here? I tried to find an answer in the XML standards, but I'm still not sure. I think I cannot prescribe using or not using CDATA's in an XSD, is that right? If so, is it not enough to agree upon an XSD, but a separate agreement has to be made about CDATA sections? Or one is obliged to be prepared to parse CDATA and regular text as well? I'm interested in both your personal views and official statements too. Thank you!

    Read the article

  • Error Creating RSS Feed XML file - Java

    - by GigaPr
    Hi, i am trying to create an RssFeed using java this is the class i use import com.rssFeed.domain.RSS; import com.rssFeed.domain.RSSItem; import java.io.FileOutputStream; import java.util.Iterator; import javax.xml.stream.XMLEventFactory; import javax.xml.stream.XMLEventWriter; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.events.Characters; import javax.xml.stream.events.EndElement; import javax.xml.stream.events.StartDocument; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; public class RssBuilder { private static String XML_BLOCK = "\n"; private static String XML_INDENT = "\t"; public static void BuildRss(RSS rss, String xmlfile) throws Exception { XMLOutputFactory output = XMLOutputFactory.newInstance(); XMLEventWriter writer = output.createXMLEventWriter(new FileOutputStream(xmlfile)); try { XMLEventFactory eventFactory = XMLEventFactory.newInstance(); XMLEvent endSection = eventFactory.createDTD(XML_BLOCK); StartDocument startDocument = eventFactory.createStartDocument(); writer.add(startDocument); writer.add(endSection); StartElement rssStart = eventFactory.createStartElement("", "", "rss"); writer.add(rssStart); writer.add(eventFactory.createAttribute("version", "2.0")); writer.add(endSection); writer.add(eventFactory.createStartElement("", "", "channel")); writer.add(endSection); createNode(writer, "title", rss.getTitle()); createNode(writer, "description", rss.getDescription()); createNode(writer, "link", rss.getLink()); createNode(writer, "dateCreated", rss.getDateCreated().toString()); createNode(writer, "language", rss.getLanguage()); createNode(writer, "pubDate", rss.getPubDate().toString()); createNode(writer, "dateModified", rss.getDateModified().toString()); createNode(writer, "dateModified", rss.getDateModified().toString()); createNode(writer, "pubDate", rss.getPubDate().toString()); createNode(writer, "lastBuildDate", rss.getLastBuildDate().toString()); createNode(writer, "language", rss.getLanguage().toString()); createNode(writer, "rating", rss.getRating().toString()); Iterator<RSSItem> iterator = rss.getRssItems().iterator(); while (iterator.hasNext()) { RSSItem entry = iterator.next(); writer.add(eventFactory.createStartElement("", "", "item")); writer.add(endSection); createNode(writer, "title", entry.getTitle()); createNode(writer, "description", entry.getDescription()); createNode(writer, "link", entry.getLink()); createNode(writer, "dateCreated", entry.getDateCreated().toString()); createNode(writer, "pubDate", entry.getDateModified().toString()); writer.add(eventFactory.createEndElement("", "", "item")); writer.add(endSection); } writer.add(endSection); writer.add(eventFactory.createEndElement("", "", "channel")); writer.add(endSection); writer.add(eventFactory.createEndElement("", "", "rss")); writer.add(endSection); writer.add(eventFactory.createEndDocument()); writer.close(); } catch(Exception e) { writer.close(); } } private static void createNode(XMLEventWriter eventWriter, String name, String value)throws XMLStreamException { XMLEventFactory eventFactory = XMLEventFactory.newInstance(); XMLEvent endSection = eventFactory.createDTD(XML_BLOCK); XMLEvent tabSection = eventFactory.createDTD(XML_INDENT); StartElement sElement = eventFactory.createStartElement("", "", name); eventWriter.add(tabSection); eventWriter.add(sElement); Characters characters = eventFactory.createCharacters(value); eventWriter.add(characters); EndElement eElement = eventFactory.createEndElement("", "", name); eventWriter.add(eElement); eventWriter.add(endSection); } } But i get the following error type Exception report message descriptionThe server encountered an internal error () that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.xml.stream.XMLStreamException: Can not write DOCTYPE declaration (DTD) when not in prolog any more (state 2; start element(s) written) root cause javax.xml.stream.XMLStreamException: Can not write DOCTYPE declaration (DTD) when not in prolog any more (state 2; start element(s) written) what does it mean?

    Read the article

  • Partially Modifying an XML serialized document.

    - by Stacey
    I have an XML document, several actually, that will be editable via a front-end UI. I've discovered a problem with this approach (other than the fact that it is using xml files instead of a database... but I cannot change that right now). If one user makes a change while another user is in the process of making a change, then the second one's changes will overwrite the first. I need to be able to request objects from the xml files, change them, and then submit the changes back to the xml file without re-writing the entire file. I've got my entire xml access class posted here (which was formed thanks to wonderful help from stackoverflow!) using System; using System.Linq; using System.Collections; using System.Collections.Generic; namespace Repositories { /// <summary> /// A file base repository represents a data backing that is stored in an .xml file. /// </summary> public partial class Repository<T> : IRepository { /// <summary> /// Default constructor for a file repository /// </summary> public Repository() { } /// <summary> /// Initialize a basic repository with a filename. This will have to be passed from a context to be mapped. /// </summary> /// <param name="filename"></param> public Repository(string filename) { FileName = filename; } /// <summary> /// Discovers a single item from this repository. /// </summary> /// <typeparam name="TItem">The type of item to recover.</typeparam> /// <typeparam name="TCollection">The collection the item belongs to.</typeparam> /// <param name="expression"></param> /// <returns></returns> public TItem Single<TItem, TCollection>(Predicate<TItem> expression) where TCollection : IDisposable, IEnumerable<TItem> { using (var list = List<TCollection>()) { return list.Single(i => expression(i)); } } /// <summary> /// Discovers a collection from the repository, /// </summary> /// <typeparam name="TCollection"></typeparam> /// <returns></returns> public TCollection List<TCollection>() where TCollection : IDisposable { using (var list = System.Xml.Serializer.Deserialize<TCollection>(FileName)) { return (TCollection)list; } } /// <summary> /// Discovers a single item from this repository. /// </summary> /// <typeparam name="TItem">The type of item to recover.</typeparam> /// <typeparam name="TCollection">The collection the item belongs to.</typeparam> /// <param name="expression"></param> /// <returns></returns> public List<TItem> Select<TItem, TCollection>(Predicate<TItem> expression) where TCollection : IDisposable, IEnumerable<TItem> { using (var list = List<TCollection>()) { return list.Where( i => expression(i) ).ToList<TItem>(); } } /// <summary> /// Attempts to save an entire collection. /// </summary> /// <typeparam name="TCollection"></typeparam> /// <param name="collection"></param> /// <returns></returns> public Boolean Save<TCollection>(TCollection collection) { try { // load the collection into an xml reader and try to serialize it. System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument(); xDoc.LoadXml(System.Xml.Serializer.Serialize<TCollection>(collection)); // attempt to flush the file xDoc.Save(FileName); // assume success return true; } catch { return false; } } internal string FileName { get; private set; } } public interface IRepository { TItem Single<TItem, TCollection>(Predicate<TItem> expression) where TCollection : IDisposable, IEnumerable<TItem>; TCollection List<TCollection>() where TCollection : IDisposable; List<TItem> Select<TItem, TCollection>(Predicate<TItem> expression) where TCollection : IDisposable, IEnumerable<TItem>; Boolean Save<TCollection>(TCollection collection); } }

    Read the article

  • Strange Misleading Error[XML -2018/ AC-10006] when doing the R12 Cloning

    - by [email protected]
    During the recent Multi Node to Single Node R12 Clone, Encountered an strange error. When doing the database portion of the clone. Below command 'adclonectx.pl' creates the Context file perl adclonectx.pl contextfile=$ORACLE_HOME/appsutil/SOURCE_CONTEXT_FILE.xml template=$ORACLE_HOME/appsutil/template/adxdbctx.tmp pairsfile=$ORACLE_HOME/appsutil/clone/pairsfile.txt initialnode   When running the same command, It dumped the below error,   file:/tmp/tmpCtxClone.xml<Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected. AC-10006: Exception - org.xml.sax.SAXParseException: file:/tmp/tmpCtxClone.xml<Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected. thrown while creating OAVars object for file: /tmp/tmpCtxClone.xml The new database context file has been created :   /opt/oracle/product/11.1.0_IOFT/appsutil/IOFT_frws35ta.xml   At first site, I suspected that the issue is with format of the source xml file. Hence compared with the working XML file. Result is clean. Below portion of the error struck me Thrown while creating OAVars object for file: /tmp//dummy.xml   Cause : The /tmp is 100% full.   Fix: Either remove the old files in /tmp  directory  OR  export TEMP=/new/location where there is plenty of free space.

    Read the article

  • Is using something other than XML advisable for my configuration file?

    - by Earlz
    I have a small tool I'm designing which would require a configuration file of some sort. The configuration file in my case is really more of a database, but it needs to be lightweight, and if needed the end-user should find it easily editable. However, it also will contain a lot of things in it. (depending on certain factors, could be 1Mb or more) I've decided I'd rather use plain ol' text, rather than trying to use SQLite or some such. However, with using text, I also have to deal with the variety of formats. So far, my options are XML JSON Custom format The data in my file is quite simple consisting for the most part of key-value type things. So, a custom format wouldn't be that difficult... but I'd rather not have to worry about writing the support for it. I've never seen JSON used for configuration files. And XML would bloat the file size substantially I think. (I also just has a dislike of XML in general). What should I do in this case? Factors to consider: This configuration file can be uploaded to a web service(so size matters) Users must be able to edit it by hand if necessary(ease of editing and reading matters) Must be able to generate and process automatically (speed doesn't matter a lot, but not excessively slow) The "keys" and "values" are plain strings, but must be escaped because they can contain anything. (unicode and escaping has to work easily)

    Read the article

  • Java -Android. Parser problem

    - by Kano
    I am making a very simple app with an RSS reader. The reader works great, but it's only giving me the title, and i want the description too. I'am very new to android, and I have tried a lot of things, but I can't get it to work. I've found a lot of parsers but they are to complicated for me to understand, so I was hoping to find a simple solution, since it's only title and description i want. Can anyone help me? import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class NyhedActivity extends Activity { String streamTitle = ""; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.nyheder); TextView result = (TextView)findViewById(R.id.result); try { URL rssUrl = new URL("http://tv2sport.dk/rss/*/*/*/248/*/*"); SAXParserFactory mySAXParserFactory = SAXParserFactory.newInstance(); SAXParser mySAXParser = mySAXParserFactory.newSAXParser(); XMLReader myXMLReader = mySAXParser.getXMLReader(); RSSHandler myRSSHandler = new RSSHandler(); myXMLReader.setContentHandler(myRSSHandler); InputSource myInputSource = new InputSource(rssUrl.openStream()); myXMLReader.parse(myInputSource); result.setText(streamTitle); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } } private class RSSHandler extends DefaultHandler { final int stateUnknown = 0; final int stateTitle = 1; int state = stateUnknown; int numberOfTitle = 0; String strTitle = ""; String strElement = ""; @Override public void startDocument() throws SAXException { // TODO Auto-generated method stub strTitle = "Nyheder fra "; } @Override public void endDocument() throws SAXException { // TODO Auto-generated method stub strTitle += ""; streamTitle = "" + strTitle; } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // TODO Auto-generated method stub if (localName.equalsIgnoreCase("title")) { state = stateTitle; strElement = ""; numberOfTitle++; } else { state = stateUnknown; } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { // TODO Auto-generated method stub if (localName.equalsIgnoreCase("title")) { strTitle += strElement + "\n"+"\n"; } state = stateUnknown; } @Override public void characters(char[] ch, int start, int length) throws SAXException { // TODO Auto-generated method stub String strCharacters = new String(ch, start, length); if (state == stateTitle) { strElement += strCharacters; } } } }

    Read the article

  • Insert a doctype into an XML document (Java/ SAX)

    - by Thom Nichols
    Imagine you have an XML document and imagine you have the DTD but the document itself doesn't actually specify a DOCTYPE ... How would you insert the DOCTYPE declaration, preferably by specifying it on the parser (similar to how you can set the schema for a document that will be parsed) or by inserting the necessary SAX events via an XMLFilter or the like? I've found many references to EntityResolver, but that is what's invoked once a DOCTYPE is found during parsing and it's used to point to a local DTD file. EntityResolver2 appears to have what I'm looking for but I haven't found any examples of usage. This is the closest I've come thus far: (code is Groovy, but close enough that you should be able to understand it...) import org.xml.sax.* import org.xml.sax.ext.* import org.xml.sax.helpers.* class XmlFilter extends XMLFilterImpl { public XmlFilter( XMLReader reader ) { super(reader) } @Override public void startDocument() { super.startDocument() super.resolveEntity( null, 'file:///./entity.dtd') println "filter startDocument" } } class MyHandler extends DefaultHandler2 { public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) { println "entity: $name, $publicId, $baseURI, $systemId" return new InputSource(new StringReader('<!ENTITY asdf "&#161;">')) } } def handler = new MyHandler() def parser = XMLReaderFactory.createXMLReader() parser.setFeature 'http://xml.org/sax/features/use-entity-resolver2', true def filter = new XmlFilter( parser ) filter.setContentHandler( handler ) filter.setEntityResolver( handler ) filter.parse( new InputSource(new StringReader('''<?xml version="1.0" ?> <test>one &asdf; two! &nbsp; &iexcl;&pound;&cent;</test>''')) ); I see resolveEntity called but still hit org.xml.sax.SAXParseException: The entity "asdf" was referenced, but not declared. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333) I guess this is because there's no way to add SAX events that the parser knows about, I can only add events via a filter that's upstream from the parser which are passed along to the ContentHandler. So the document has to be valid going into the XMLReader. Any way around this? I know I can modify the raw stream to add a doctype or possibly do a transform to set a DTD... Any other options?

    Read the article

  • "Java & XML" job title

    - by Aspiring developer
    When people say they are a "Java & XML" developer, what do they mean? Are they saying they create XML data to be used in applications, or they use XML to configure a framework like Spring or Hibernate? What other ways are there to use XML in a Java application?

    Read the article

  • Middle East XML Currency Conversion

    - by Tim
    Using the following script to do currency conversion which relies on an XML feed. http://www.white-hat-web-design.co.uk/articles/php-currency-conversion.php It grabs the data from the following feed... var $xml_file = "www.ecb.int/stats/eurofxref/eurofxref-daily.xml"; However this XML feed has limited currencies and I require currencies for the Middle East. Does anyone know where I can find an XML file with Middle East currencies or have any better suggestions?

    Read the article

  • Create an Xml file from an object

    - by remi bourgarel
    I work as a web developer with a web designer and we usually do like this : - I create the system , I generate some Xml files - the designer display the xml files with xslt Nothing new. My problem is that I use Xml Serialization to create my xml files, but I never use Deserialization. So I'd like to know if there is a way to avoid fix like these : empty setter for my property empty parameter-less constructor implement IXmlSerializable and throw "notimplementedexception" on deserialization do a copy of the class with public fields

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >