Hi,
I have a xml document holding a small data for my project where I want to convert my xml to an excel file (microsoft office excel 2003 and over)
How can I do this?
Kind Regards.
My project is like a classifieds kind of stuff..
I have a search text box in the first page.
When the user enters some text in that, i need to compare that text to the XML file from where all the data are being recieved, and should list out all the advertisements in the Table View (next page)..
I had did this kind of search in sql database..but not with XML..
Just need some help..
Is it possible using php's XMLWriter to insert a new node to an existing xml file, and then save the file. This would be much more benficial to me that actually creating a enw file every time i want to update an xml file.
Hi,
Can anyone point me the tutorial for step by step creating my onw XML custom result formatter. I read that we can create our own result formatter by specifying the XSLT in styledir.
I want to know what should specify in XSLT, like the xml tag for testsuite name, testcase name and the result.
Thanks in advance
Hi Guys!!
I am reading data and filling a data set and want to return xml, in a .net web service.
so far I am trying to use
return mydataset.getxml();
but it is not helping as my method return type is "DataSet"
so is there any way I can get a well formatted xml.
Thanks
I'm currently reading a regularly updated XML file with PHP (simpleXML).
I'd like to reduce calls to the remote server by reading a cache file on my web server, then after some time, retrieving a new copy of the remote file.
Is this an accepted practice for reading remote XML files, then parsing? Can anyone offer some suggestions on how to go about this in PHP, or perhaps there are some PEAR classes that deal with this?
http://www.sendspace.com/file/2zlfgn
I have the php files i been trying to get them to save to xml.
I have tried
$product1=array();
$product1['id'] = new product( "19990","modrl","maf","purpose","war");
only the ID writes to xml. since model,maf etc are sub-elements is there a different way to create the objectarray?
I have been working on this program which inserts an XML file into a MYSQL database. I'm new to the whole .jar idea by inserting packages. Im having an issue with parse(), select(), and children(). Can someone inform me how I could fix this issue? Here is my stack trace and my program below:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method select(String) is undefined for the type Document
The method children() is undefined for the type Element
The method children() is undefined for the type Element
The method children() is undefined for the type Element
The method children() is undefined for the type Element
at jdbc.parseXML.main(parseXML.java:28)
import java.io.*;
import java.sql.*;
import org.jsoup.Jsoup;
import org.w3c.dom.*;
import javax.xml.parsers.*;
public class parseXML{
public static void main(String xml) {
try{
BufferedReader br = new BufferedReader(new FileReader(new File("C:\\staff.xml")));
String line;
StringBuilder sb = new StringBuilder();
while((line=br.readLine())!= null){
sb.append(line.trim());
}
Document doc = Jsoup.parse(line);
StringBuilder queryBuilder;
StringBuilder columnNames;
StringBuilder values;
for (Element row : doc.select("row")) {
// Start the query
queryBuilder = new StringBuilder("insert into customer(");
columnNames = new StringBuilder();
values = new StringBuilder();
for (int x = 0; x < row.children().size(); x++) {
// Append the column name and it's value
columnNames.append(row.children().get(x).tagName());
values.append(row.children().get(x).text());
if (x != row.children().size() - 1) {
// If this is not the last item, append a comma
columnNames.append(",");
values.append(",");
}
else {
// Otherwise, add the closing paranthesis
columnNames.append(")");
values.append(")");
}
}
// Add the column names and values to the query
queryBuilder.append(columnNames);
queryBuilder.append(" values(");
queryBuilder.append(values);
// Print the query
System.out.println(queryBuilder);
}
}catch (Exception err) {
System.out.println(" " + err.getMessage ());
}
}
}
I want to query a xml file.
I read this http://weblogs.asp.net/scottgu/archive/2007/08/07/using-linq-to-xml-and-how-to-build-a-custom-rss-feed-reader-with-it.aspx ,
But in my case i don't know the names of elements and attributes of the file.
So i could i do ?
Thanks
Hi,
I use a main SWF file, which has some animations. It uses xml from a .php file which specifies several items, e.g. images and other SWFs to be used in the main SWF. Locally everything works perfectly, but when invoking it via my home server, or hosting provider it doesn't work anymore and I don't get why. All links are relative and correct. Somehow the main SWF doesn't load fully, or has problems with the XML from the .php file. I'm not sure, now I only get a black box that doesn't show any of the other content it's supposed to.
check it out: http://deoshermes.ath.cx/cc-common/templates/dynamiclead/dynamic_leadee.swf
the XML:
<?xml version="1.0" ?><dynamic_content>
<item
blurb="Text 1"
content_url=""
content_source=""
content_timer="8000"
content_target="_self"
tab_color="0x000000"
tab_border_color="0x000000"
tab_arrow_color="0xFFFFFF"
tab_text_color="0xFFFFFF"
tab_image="/template/images/dle_TOPmay06.jpg"
cycle="true"
content_border_color="0x"
content_bg_image=""
tab_hl_color="0x000000"
tab_highlight_color="0x"
tab_highlight_text_color="0x"
tab_highlight_image="" >
</item>
<item blurb="Text 2"
content_timer="5000"
cycle="true"
content_border_color="0x"
content_bg_image=""
tab_hl_color="0xFFFFFF"
tab_border_color="0xFFFFFF"
tab_color="0xFFFFFF"
tab_arrow_color="0xFFFFFF"
tab_text_color="0xFFFFFF"
tab_image="/template/images/dle_MIDandBOTmay06.jpg"
tab_highlight_color="0x"
tab_highlight_text_color="0x"
tab_highlight_image=""
content_url=""
content_source=""
content_target="_self" >
</item>
<item blurb="Text 3"
content_timer="5000"
cycle="true"
content_border_color="0x"
content_bg_image=""
tab_hl_color="0xFFFFFF"
tab_border_color="0xFFFFFF"
tab_color="0xFFFFFF"
tab_arrow_color="0xFFFFFF"
tab_text_color="0xFFFFFF"
tab_image="/template/images/dle_MIDandBOTmay06.jpg"
tab_highlight_color="0x"
tab_highlight_text_color="0x"
tab_highlight_image=""
content_url=""
content_source=""
content_target="_self" >
</item>
</dynamic_content>
this works like a charm when invoking the main SWF locally.
The ActionScript from the main sWF can be found at samedomain as above/Actionscript_mainmovie.txt
This also seems to work great. the function formattabs (line 68) uses some javascript. Locally the main SWF functions even without this hbx file which is located
/cc-common/wss/hbx.js and use in the webpage actually.
I haven't got a clue what's keeping the main SWF from working properly, because all other single SWFs work properly when invoked using a direct link. And this one just isn't working... Do I maybe need to add something in the php.ini file??
Any help would be appreciated!
I'm trying to find something like this: http://coffeescripter.com/code/ad-gallery/ that is controlled by an xml file that can simply contain the image location, thumbnail location and the text for title/description. Has to be pure jquery or javascript though - no flash based stuff.
I've found loads of great components but can't find one that is controlled by XML. Anyone happen to have seen one around anywhere please?
The default methods for dealing with xml in c# seem incredibly crude to me, leading me to suspect that I must be missing something in my searches. What is considered the standard best practices to parse xml files in c#?
Hi,
I am using StAX XML stream writer to write the XML file. It writes all the data in a single line. I want all the tags to be indented instead of a single line.
This snippet <!--Please don't delete this--> is part of my xml file. After running this method, the resulting xml file does not contain this snippet anymore <!--Please don't delete this-->. Why is this?
Here's my method:
XmlSerializer serializer = new XmlSerializer(typeof(Settings));
TextWriter writer = new StreamWriter(path);
serializer.Serialize(writer, settings);
writer.Close();
What is the best way to generate soap xml in c#? I prefer to use xml-serialization if possible. Also, I need to add some custom attributes to the soap header, so not sure if this complicates things.
I having an XML file and that file is under the Documents folder.
If I actually give the entire path in C# then I am able to retrieve the XML values, but if I give the project path then it is not getting the values.
For example:
string fileNamePath=ConfigurationManager.AppSettings["XMLDocPath"].ToString() + fileName;
m_xmld.Load(fileNamePath);
It is throwing a runtime error.
Hi, for a certain project, I need some way to parse XML and get data from it. So I wonder, which one of built-in parsers is the fastest?
Also, it would be nice of the parser could accept a XML string as input - I have my own implementation of thread-safe working with files and I don't want some nasty non-thread-safe libraries to make my efforts useless.
I am looking for a way to comment the current selection in an xml file in eclipse (STS 2.3.2).
ctrl+/ gets seems to get ignored when editing XML.
Google left me on my own.
I have to convert a dll file to XML in command line. I've created an xsd file fron the dll (by the command :xsd.exe ---.dll) now I'm searching command that can create the XML. Can so,one help me??
I have the following XML file:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
I need to write a XML path that returns a book published after 2003, category is children and I just need to display the author and title of the book? What is frustrating is that I have everything in the XPATH that wrote except I am missing the author.
Hi,
How can i load external xml file in Action Script 3.0, I have seen a tutorial http://webdeginer.blogspot.com/2010/06/external-xml-loading.html, is it right or I have to see any more tutorials.
Thanks,
K Swamy Vishnubhatla,
webdeginer.blogspot.com.
The default methods for dealing with xml in c# seem incredibly crude to me, leading me to suspect that I must be missing something in my searches. What is considered the standard best practices to parse xml files in c#?
I'm working with an xml file that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<element1 xmlns="http://namespace1/">
<element2>
<element3>
<element4 attr1="2009-11-09">
<element5 attr2="NAME1">
<element6 attr3="1">
<element7 attr4="1" attr5="5.5" attr6="3.4"/>
</element6>
</element5>
<element5 attr2="NAME2">
<element6 attr3="1">
<element7 attr4="3" attr5="4" attr6="4.5"/>
</element6>
</element5>
</element4>
</element3>
</element2>
</element1>
Where I need to loop through element5 and retrieve the attributes in an Ienumberable like this:
attr1, attr2, attr3, attr4, attr5, attr6
using linq to xml and c#. I can loop through the element5 and get all the attribute2 info using but I can't figure out how to get the parent or child attributes I need.
UPDATE: Thanks for the feeback thus far. For clarity, I need to do a loop through attribute5. So basically, what I have right now (which isn't much) is . . .
XElement xel = XElement.Load(xml);
IEnumberable<XElement> cList = from el in xel.Elements(env + "element2").Element
(n2 + "element3").Elements(n2 + "element4").Elements(ns + "element5") select el;
foreach (XElement e in cList)
Console.WriteLine(e.Attribute("attr2").Value.ToString());
This will give me the value all the attr 2 in the loop but I could be going about this all wrong for what I'm trying to acheive. I also need to collect the other attributes mentioned above in a collection (the Console reference is just me playing with this right now but the end result I need is a collection). So the end results would be a collection like
attr1, attr2, attr3, attr4, attr5, attr6
2009-11-09, name1, 1, 1, 5.5, 3.4
2009-11-09, name2, 1, 3, 4, 4.5
Make Sense?
I have an xml file which holds a set of "game" nodes (which contain details about saved gameplay, as you'd save your game on any console game). All of this is contained within a "games" root node. I'm implementing save functionality to this xml file and wish to be able to append or overwrite a "game" node and its child nodes within the "games" root node.
How can this be accomplished with xmllite.dll?
select @[email protected]('*')
for xml raw,type
Above statement will generate following alert:
Msg 6819, Level 16, State 3, Line 2
The FOR XML clause is not allowed in a ASSIGNMENT statement.