xml

How can I create xml schema that suitable to my table constaint

I have a table that has a constraint. when field a = 1 then field b must be not null and when field1= 2 then field c must be not null. How can I create xsd file that contains these rulls? ...

Custom attributes in an xsd-schema

I'm trying to make a simple xml-editor for some basic but specific needs, the thing that I'm not sure how to handle is that I want to be able to have own custom attributes (or something) in the xsd-schema itself. Something like this is what I had in mind: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <xsd:element name...

Pros and cons for different configuration formats?

I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django). My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less verbose) or a Pytho...

PHP read XML properties

I have the following XML data which is generated by a webservice <?xml version="1.0" encoding="UTF-8"?> <rsp xmlns="http://worldcat.org/xid/isbn/" stat="ok"> <isbn oclcnum="263710087 491996179 50279560 60857040 429386124 44597307" lccn="00131084" form="AA BC" year="2002" lang="eng" ed="1st American ed." title="Harry Potter and...

How to validate, on runtime, xml against xsd without save the xsd file on local folder?

Hello. My objective is to validade a xml file against the xsd whitch is in a string variable. Ps.: I already wrote a question numbered 3072697 on Friday. But I couldn't add this code today. book.xml: <?xml version="1.0" encoding="utf-8"?> <author xmlns='urn:bookstore-schema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&gt; ...

How to encrypt fields in XML document with PHP and RSA / Triple DES

I am developing an application for schools in South Africa which is required to submit data in XML format to the State IT Agency for statistical processing. I am currently generating the XML files using PHP's DOMDocument class. My files have gone through a first stage verification process. The next stage is to implement encryption and c...

Problem with java XML Parsing - FactoryConfigurationError: Provider not found

I have a java applet that parses a string of xml. However, running the following code: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document d = db.parse(xml); Generates the following error: javax.xml.parsers.FactoryConfigurationError: Provider <HTML> not found S...

In-memory XML manipulation

I'm trying to do a find and replace in an OpenXML word document which I've openened into a MemoryStream. using (WordprocessingDocument _document = WordprocessingDocument.Open(_ms, true)) { var placeHolder = _document.MainDocumentPart.Document .Descendants<DocumentFormat.OpenXml.Wordprocessing.Text>() ...

Tree View/Navigation in XForms

Hi! I am wondering.. is tree view/navigation possible to do (and somewhat easily) in XForms given a XML data structure? If it is possible, where can I find a really excellent example (code and hopefully a working form to view)? Also, are there any tips you have for implementing this? (I'm new to XForms, and only know the basics so far...

Encrypt XML Elements with X.509 Certificates

I have copy the samples from msdn site: http://msdn.microsoft.com/en-us/library/ms229744%28v=VS.90%29.aspx http://msdn.microsoft.com/en-us/library/ms229943%28v=VS.90%29.aspx I've created a certificate, but when i run the program i have this error in the Decrypt method: "Unable to retrieve the decryption key" I've read somewhere that ...

Hyperlinks in xml?

Hi, I am writing a small test program that gives the following xml file as output: <Books> <Fiction> <Name>Book_Name</Name> <Price>price in $</Price> <Details>hyperlink to the book's page</Details> </Fiction> </Books> I have written this program in C# and write out this xml from LINQ. I want to add hyperlink to th...

PHP Moving config mapping file to XML but how to I create a dynamic XPATH

So I have a PHP file that I use to define all my constants but now want the flexibility of using a XML instead. Example PHP Config file define("LOGIN_URL", "secure_login.php"); define("REDIRECT", "redirect.php"); define("MAPPED_VALUE_GREEN", "object_green"); define("MAPPED_VALUE_KEY", "object_key_12345"); What I'm going to do is: <...

Android XML Layout - 4 ImageViews on one screen

Hello, I thought I have understood the XML layout of Android, but it seems that I haven't. I want to have four ImageViews on one screen, to view four images at the same time. It should look like this, where A to D represents the image views: DDDAAA DDDAAA BBBCCC BBBCCC How can I do that? I tried it this way, but it's not working. The...

How can I move an XML element above the previous element using LINQ to XML?

I have the following XML structure: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Root xmlns:xsi="My Program"> <NotRoot Text="Hello"> <SomeOption Text="Option 1" Centered="False"> <SomeOption Text="Option 1.1" Centered="False"> <SomeOption Text="Option 1.1.1" Centered="false"> ...

Problem using SAXParser to get a list of strings to an arraylist

I'm trying to parse a web service response using SAXParser and get certain values, store them into an arraylist, then display them in a listview. Example XML being returned from web service: <ArrayOfStrings> <string>value</string> <string>value</string> <string>value</string> </ArrayOfStrings> Here is my SAXHandler class: public clas...

Is there a way to XSLT to echo out the XML powering it?

Basically I am using some XSLT to transform XML, is there a way for the XSLT to spit out the XML that is feeding it? Something like: <xsl:echo-xml /> ...

Object/XML Backwards-Compatibility

We store objects in XML. Sometimes we update the base objects, then we have to save more data in our files to represent the extra attributes of our objects. How to organize/implement a system to ensure backwards compatibility with old versions of our files? The complicated part comes when looking at several versions at once. Version...

XML mapping and validation for Rails models

I am implementing an application that manipulate XML documents using Ruby on Rails. I want to have models that encapsulate all the logic and then convert them to corresponding XML document when save. Although I do not need database persistence for my models, I want my models to have validation mechanism like ActiveRecord's. Also, for con...

Error in xsd when trying to validate with infinite sub lists

Given the following xml example: <MyCustomXml> <ClientId>SomeGuid</ClientId> <Contact>[email protected]</Contact> <Data> <Item name="SomeName" type="String"> SomeValue </Item> <Item name="SubList" type="List"> <Data> <Item name="AnotherItem" type="String"> ...

Displaying line breaks in XML using ASP.NET with XSLT

Hello all, I have a problem with my XML that I am trying to display on my ASP.NET page that I could do with some help with. What I would like to do is display it on a multi-line so I have an XML file that looks like this: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="News.xslt" ?> <newslist> <news> <date>20th June ...