What is the fastest, one-liner/shortest way to get an Array of "strings/that/are/paths" from an XML file, using Nokogiri preferably. I'd like to build the array with an arbitrary attribute name ('id' in this case), but also knowing how to do it for the element name would be helpful.
So this:
<root id="top">
<nodeA id="almost_top"...
Hi all,
I'm currently using Microsoft CRM4 Mail merge function, which stores Word files as XML files inside CRM. My client has a requirement to prompt the user for more information (not found in CRM) upon mail merging.
Previously, we used the Word 'FILLIN' commands, but it does not work with CRM mail merge as it only prompts the use...
I want to start using XML-Documentation of my code and am desperately searching for an up-to-date (meaning .NET-3.5 SP1) to do so.
I found NDoc, but it only supports .NET-1.1 and that a little bit far away ;-)
Any suggestions?
...
I have this function for validate xml messages against external schema file:
private bool IsValidMessage(string message, XmlDocument xDoc)
{
this.valid = true;
byte[] bytes = Encoding.UTF8.GetBytes(message);
MemoryStream ms = new MemoryStream(bytes);
ms.Flush();
ms.Position = 0;
XmlReaderSettings xSettings ...
Consider the code below
XmlSerializer serializer = new XmlSerializer(typeof(Invoice));
using (TextWriter writer = new StreamWriter(fileName))
{
// Serialize the object, and close the TextWriter.
serializer.Serialize(writer, invoice);
writer.Close();
}
No encoding is set on the stream writer by default. Does it def...
Hi
I'm generating a lot of XMPP stanzas, and want to validate them against the specs available here in my unit tests.
At the moment I am using Nokogiri to achieve this with something like
xml = Nokogiri::XML( xmpp_stanza)
schema = Nokogiri::XML::Schema( xmpp_schema )
assert schema.valid?( xml )
Now this works fine except it gets...
Uploading a file, i want to have an XML response from server.
So, in php, i do:
header("Content-type:text/xml");
echo"<whatever/>"; // any 100% valid XML
in flash, i use FileReference class and FileReference.upload() method
var file:FileReference = new FileReference();
file.addEventListener(Event.SELECT, FileSelected);
file.addEvent...
Hi all,
I'm working for a client who's been using this XML structure for his website's content:
<section title="title1" layoutType="VideoViewer" xmlPath="xml/ita/title1.xml" pageTitle="extended title" previewImg=""/>
<section title="another title" layoutType="TimeLine" xmlPath="xml/ita/timeline.xml" textFile="" pageTitle="extended tit...
I receive some xml-files with embedded base64-encoded images, that I need to decode and save as files.
An unmodified (other than zipped) example of such a file can be downloaded below:
20091123-125320.zip (60KB)
However, I get errors like "Invalid length for a Base-64 char array" and "Invalid character in a Base-64 string". I marked t...
I would like to compute the diff between two XML files or nodes using XSL/XSLT. Is there any stylesheet readily available or any simple way of doing it?
...
I'm building a small application and to reduce hosting costs and dependencies, I am planning to store all persistent data to xml files rather than a Sql Server database.
In this case, the site audience is limited to friends and family - no more than a few concurrent users are ever expected, so the site does not need to scale. Is it fea...
Try this:
var doc1 = XDocument.Load(@"C:\any.xml", LoadOptions.SetLineInfo);
var doc2 = new XDocument(doc1);
doc2 no longer has any line number information. Digging in with Reflector, I can see that when the nodes are cloned from doc1 to doc2 this does not preserve the annotations on the XObject base type, which includes the line numb...
What exactly is the BOM in a ANSI XML document and should it be removed? Should a XML document be in UTF-8 instead? Can anyone tell me a Java method that will detect the BOM? The BOM consists of the characters EF BB BF .
...
Dear all:
I have encountered a problem that I need to import a huge XML (> 1Gb) into SQL Server 2008 daily. What I have now is a sample XML file and the XML schema of it. The XML schema is pretty complex which contains many custom defined simple type, and element with complex type such as:
<xs:element name="xxxx_url">
<xs:complexT...
Hello,
I'm working on a program that needs to be able to load object-properties from an XML file. These properties are configurable by the user and XML makes sense to me to use.
Take the following XML document.
<?xml version="1.0" encoding="utf-8" ?>
<udpcommands>
<command name="requser">
<cvar name="reqchallege" value="false"...
Hello, I'm learning XSLT and Javascript and I'm trying to load some XSLT generated XHTML using the loadXML() function and I'm getting the following parsing error while using IE (might also be happening in FF to, not sure)...
The server did not understand the request, or the request was invalid. Error processing resource 'http://www.w3.o...
I have an xml feed at this url
Now im trying parse the content, particularly the content in <REDIRECT></REDIRECT> tags.
I use the following code to try and parse the content but it isnt working and im not sure what im doing wrong.
$xml_file = $ADurl;
$xml_headline_key = "*XML*RESULTS*LISTING*REDIRECT";
$xml_description_key = "*XML*RES...
What I want to do:
Pull information (numbers, words, etc) from fields that are either in an XML document or in an Excel spreadsheet, and embed these values in a text paragraph inside of a PowerPoint presentation.
Example:
Yearly, the production of product Y
has reached <###> thousand units.
where <###> is some value pulled fro...
I want the same as WebBrowser.Document.Body.InnerHtml, but as an XML representation.
...
Hi,
Does anyone know of a good solution to convert from XML to JSON and then back to XML?
I found two tools for jquery, xml2json & json2xml.
Each of these works very well - however, the conversions they use aren't 100% consistent.
Has anyone encountered this situation before?
...