|
okay do this
System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();
xdoc.XmlResolver = null;
xdoc.Load(this._XmlFilePath);
System.Xml.XmlElement Node = (System.Xml.XmlElement)xdoc.DocumentElement.SelectSingleNode("//configuration/connectionStrings/add[@name=\"Application.Properties.Settings.DBConnectionString\"]");
if (Node != null)
{
Node.Attributes.GetNamedItem("Source").Value = "C:\DataDabe\DB.mdb";
xdoc.Save(this._XmlFilePath);
}
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
perfect thanks!!!
"For as long as men massacre animals, they will kill each other. Indeed, he who sows the seed of murder and pain cannot reap joy and love." Pythagoras
|
|
|
|
|
Hi All,
I have one weird problem in my XSL transform. The Java code is writing data into XSL using XMLWriter.
The Java code line looks like this ...
xmlWriter.writeElement( "notation", "(A)=(B)+(C)");
I dont want to do any String concatenation here and I wanted the out put in XSL as (A)=(B)+(C)
But I see the + symbol is missing in my XSL out put and value get displayed as (A)=(B)(C)
I use UTF-8 encode in my XSL .
Is there any encoding mechanism ? Is it possible to handle at Java or XML level ?
Please share your thoughts out of your experience .
* Thanks
|
|
|
|
|
I am using Silverlight 4 and WCF
In the WCF I write a datatable to a stringreader and return the string to the UI. In the UI I need to turn the string into an object (Telerik datatable class) which requires that I read the elements to create the columns and the data to populate the rows.
Problem is when the data has null values the xml does not get a full set of elements, the table is invalid in the UI. To solve this I want to include the schema in the string passed to the UI.
However I cannot work out how to get the schema out of the xDocument. This receives the string and creates the xDocument, I then need to get the schema to create the columns
void GenericProcedureCompleted(object sender, GenericProcedureCompletedEventArgs e)
{
svcClient.GenericProcedureCompleted -= new EventHandler<GenericProcedureCompletedEventArgs>(GenericProcedureCompleted);
ShowError(e.sErrorMsg);
if (!string.IsNullOrEmpty(e.Result))
{
System.IO.StringReader sr = new System.IO.StringReader(e.Result);
XDocument xDoc = XDocument.Load(sr);
CreateTable(xDoc);
}
}
This is currently using the elements to create the table
xEl = xDoc.Descendants("XMLData").ToList()[0];
foreach (XElement xe in xEl.Elements())
{
oCol = new CTUI.Data.DataColumn();
oCol.ColumnName = xe.Name.LocalName;
oCol.DataType = typeof(string);
dtData.Columns.Add(oCol);
}
Ant suggestions that are valid for Silverlight 4 will be welcome. Note Silverlight 4 does not support all xml structures.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Everyone,
Can anyone help me in xsl drop down which i need to display the selected value. I have two pages.
First Page
I have written a html tag in xsl which has six options say one,two....
After selecting one of the value it is stored in the database.
Second Page
Here also I have written the same html tag in xsl. but here the issue is i need to display the selected value which is retrieved from database.
Please let me know if any one has a sample code
Thanks in Advance .
Regards,
Manowj
|
|
|
|
|
Hi, I asked a Q in C# forum, but i also trying here.
please help me with this Q
many thanks
|
|
|
|
|
Hi.
How can i save a word document to xml format for parsing later with xslt.
I noticed that word 2007-2010 document are constructed with the openxml format so i can use openxml tools to save it.
But word 2000-2003 seems to be in binary format.
Is there a tool that i can use for this mission?
Thanks
|
|
|
|
|
don't post same question in more than one forum.
It create cross post. be aware from it.
|
|
|
|
|
How do I include PHP codes in an XML file?
I have a FLASH Gallery that i want to alter the names of the photo's
but i can't do that because i don't know how to include the PHP in the XML file ,, can you help me ?
|
|
|
|
|
We need more details in order to answer this.
Why do you want to embed PHP in the XML? How is the XML being used? This sounds potentially dangerous.
|
|
|
|
|
how I can create multiple XML files from a single XML file using xsltproc?
|
|
|
|
|
If you are using XSL 2, you can use xsl:result-document to target multiple output documents.
|
|
|
|
|
I must use XSLTProc
it does not support XSLT 2.0
|
|
|
|
|
The only way I can see to do this with this tool then is to have multiple XSLT files and run them in sequence. It's not pretty, but XSLT 1 was not designed for a 1-in to many-out scenario.
|
|
|
|
|
|
You are welcome. I hope we have helped.
|
|
|
|
|
Good afternoon.
I have the following XML file structure:
<?xml version="1.0" ?>
- <WEB_SITE>
- <RECORD>
<Name>Homepage</Name>
<Address>http:
</RECORD>
</WEB_SITE>
I would like to derive the URL from the XML file if the name is Homepage.
I have this so far:
string strtmpName = string.Empty;
string strtmpAddress = string.Empty;
XmlTextReader reader = null;
XDocument xmlDoc = new XDocument();
reader = new XmlTextReader(cv.StrIndivPath1 + strLANID + cv.StrIndivPath2 + "Website.xml");
xmlDoc = XDocument.Load(reader);
reader.Close();
XElement Results = XElement.Parse(xmlDoc.ToString());
foreach (XElement xe in Results.Elements("RECORD").Descendants())
{
switch (xe.Name.ToString())
{
case "Name":
if (xe.Value.ToLower() == "homepage")
{
strtmpAddress = Results.Elements("RECORD").Descendants("Address").ToString();
MessageBox.Show(strtmpAddress);
}
break;
default:
break;
}
}
Any suggestions? Thank you, WHEELS
|
|
|
|
|
XPath can be used. Here is how it works:
String myXPath="/WEB_SITE/RECORD[Name='Homepage']/Address";
XmlNodeList myNodeList=xmlDoc.SelectNodes(myXPath);
XmlNode myXmlNode;
foreach (myXmlNode in xmlNodeList)
{
MessageBox.Show(myXmlNode.Value);
}
Cheers!
|
|
|
|
|
I am getting a Type and identifier are both required in a forach statement.
|
|
|
|
|
well you have to add this :
using System.Xml.Xpath;
so that it can identify the XPath.
|
|
|
|
|
Excellent. That does the trick. Thank you.
|
|
|
|
|
|
In order to use SelectNodes to select nodes and attributes that have a namespace prefix, you need an XmlNamespaceManager that knows about the namespace and prefix. Unfortunately, I haven't found a way to access a pre-populated XmlNamespaceManager or to automagically populate one from an XmlDocument.
According to the documentation, XmlReaders use XmlNamespaceManagers, so after I load a document with an XmlReader I should be able to copy the XmlReader's XmlNamespaceManager -- but it shows null (and requires Reflection). I should be able to pass an XmlNamespaceManager to an XmlReader and the XmlReader should use it -- but it still shows null.
I've gone through a bunch of documentation and searching articles here and elsewhere hasn't yielded a silver bullet. They all show code calling AddNamespace to add specific namespaces -- I need it to be dynamic.
So I'm trying to roll my own. At this point, I'm loading the document with an XmlReader and then trying to query any attributes in the xmlns namespace, I should then be able to populate an XmlNamespaceManager with AddNamespace.
The code, as I have it now (I've tried several variations of the XPath) is:
System.Xml.XmlNamespaceManager result =
new System.Xml.XmlNamespaceManager ( Document.NameTable ) ;
System.Xml.XmlNodeList nodes = Document.DocumentElement.SelectNodes ( "//@xmlns:*" , result ) ;
This should yield all the attributes in the xmlns namespace (and the document contains one), but the list comes up empty.
0) Can anyone provide me with an XPath that will do what I want?
1) Does anyone know how to get a pre-populated XmlNamespaceManager from an XmlReader or an XmlDocument?
|
|
|
|
|
I used this:
if (namespace_found)
{
nsmgr = gcnew XmlNamespaceManager (doc->NameTable);
nsmgr->AddNamespace(L"ie", DocNamespace);
}
namespace_found is set to true when a namespace and schema are present on the XML file.
I couldnt add a schema to the XML file at run time.
GER
Ger
|
|
|
|
|
In order to at least have something that works, I now have:
public static System.Xml.XmlNamespaceManager
GetNamespaceManager
(
System.Xml.XmlDocument Document
)
{
System.Xml.XmlNamespaceManager result =
new System.Xml.XmlNamespaceManager ( Document.NameTable ) ;
System.Xml.XmlNodeList nodes = Document.DocumentElement.SelectNodes ( "//*" , result ) ;
foreach
(
System.Xml.XmlNode nod
in
nodes
)
{
foreach ( System.Xml.XmlAttribute att in nod.Attributes )
{
if ( att.Prefix == "xmlns" )
{
result.AddNamespace ( att.LocalName , att.Value ) ;
}
}
}
return ( result ) ;
}
Which gets the job done, and I suppose that's what the framework would be doing anyway so it shouldn't be too much slower. But, if the XmlReader builds one anyway, I sure wish I could access it and not have to build my own.
|
|
|
|