|
Hi,
I want to create a tree structure like there is a root element and the root contains left and right nodes,again these nodes contains right and left nodes likewise.Here I want this dynamically.How can insert the nodes,delete the nodes.Please help me in this issue.
Thanks
Denny
|
|
|
|
|
|
I extracted the element <wsu:expires>;2007-10-03T21:12:23Z</wsu:Expires>. I don't know how to encrypt this?
Output should be something like this.
<wsu:Timestamp >
<wsu:Created></wsu:Created>
<xenc:EncryptedData >
<xenc:EncryptionMethod />
<xenc:CipherData >
<xenc:CipherValue </xenc:CipherValue>
</xenc:CipherData>
</xenc:CipherData>
</xenc:EncryptedData>
</wsu:Timestamp>
modified on Thursday, June 4, 2009 3:07 AM
|
|
|
|
|
Hello
I am using client WSDL file, i want to generate proxy class from it.
I am using WSDL.exe to generate that proxy class.
But i am getting this error:
Unable to cast object of type 'System.Xml.XmlElement' to type 'System.Web.Services.Description.ServiceDescriptionFormatExtension'.
So, is there any perfect solution?
|
|
|
|
|
|
I have a problem I'm looking to solve with XSLT, but I'm a bit stumped at how to implement the syntax.
I basically have a XML file with a structure narrowed down to this:
<ITEM>
<NAMEVALUE>
<NAME>From1</NAME>
<VALUE>From1 Value</VALUE>
</NAMEVALUE>
<NAMEVALUE>
<NAME>From2</NAME>
<VALUE>From2 Value</VALUE>
</NAMEVALUE>
<NAMEVALUE>
<NAME>Price1</NAME>
<VALUE>Price1 Value</VALUE>
</NAMEVALUE>
<NAMEVALUE>
<NAME>Price2</NAME>
<VALUE>Price2 Value</VALUE>
</NAMEVALUE>
.
.
.
.
</ITEM>
(I can't change the format of the delivered file).
I would like to transform it into something equivalent to:
<Prices>
<Price from="From1 Value">Price1 Value</Price>
<Price from="From2 Value">Price2 Value</Price>
</Prices>
And I'm quite bugged down in it.
I can most likely fix it using scripts in my XML file and some temporary variables, but I was wondering if it would be possible to either use more pure XSL syntaxt to solve this problem.
|
|
|
|
|
Alsvha wrote: I was wondering if it would be possible to either use more pure XSL syntaxt to solve this problem.
I don't understand how "From1 Value" is related to "Price1 Value" in the XML source?
|
|
|
|
|
They're related due to the name From1 is connected to Price1 and From2 to Price2 and so forth.
It is an unfortunate format, but it is what I have to work with
|
|
|
|
|
Alsvha wrote: It is an unfortunate format
Yes. I can't help you exercise the demons from the people that created that XML nightmare, however Stuart has provided an example for you.
exercise exorcise
modified on Thursday, June 4, 2009 1:45 PM
|
|
|
|
|
The following works (i.e. I've tested it) in Microsoft XSLT - but it. It creates a key containing all 'Price' NAMEVALUE nodes, indexed on the text after 'Price' in the NAMEVALUE/NAME node. This is used in the 'From' NAMEVALUE node template, to establish the linkage between 'From' and 'Price' nodes.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="prices" match="/ITEM/NAMEVALUE[starts-with(NAME/text(), 'Price')]" use="substring-after(NAME/text(), 'Price')"/>
<xsl:template match="/">
<prices>
<xsl:apply-templates select="//NAMEVALUE"/>
</prices>
</xsl:template>
<xsl:template match="NAMEVALUE[starts-with(NAME/text(), 'From')]">
<Price from="{VALUE/text()}">
<xsl:value-of select="key('prices', substring-after(NAME/text(), 'From'))/VALUE"/>
</Price>
</xsl:template>
<xsl:template match="NAMEVALUE"/>
</xsl:stylesheet>
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Now that's some nice XSLT! Great example of using key, get's my 5.
|
|
|
|
|
Thank you so much - I'll try to take a look at it.
|
|
|
|
|
Hi, I'm a bit new to XML schemas and I've run into a scenario that I am unable to discover how to describe in an XML schema. I need to have a shema describe the following two document scenarios (Simplified from my real project)
<root>
<header>
header elements here
</header>
<detailedinfo>
detailed information here
</detailedinfo1>
</root>
<root>
<header>
header elements here
</header>
<differentinfo>
different detailed information here
</differentinfo>
</root>
I actually have several different types of detailed information that I need to be able to optionally have in the XML. I know that I can allow for the different information with a choice, but I can not discover how to get the header information into the schema.
One other thing, the hearer must be optional as well.
Thanks in advance!
|
|
|
|
|
Hi!
Let's say you have an xml file that you want to transform which also includes other XMLs, e.g. something like
<rootnode>
<info>Info<info>
<import file="other.xml"/>
</rootnode>
Is there a standard/easy way to read in and process (i.e. apply the same xsl rules to) the imported xml as well?
Thanks,
Agoston
|
|
|
|
|
Use the document() function - possibly something like the following might work?
<xsl:template match="info[@file]">
<xsl:apply-templates select="document(@file)"/>
</xsl:template>
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Experts,
I am developing 3 Tier Architecture with Web Service.
Graphically as : (Overall Structure)
UI (C# Application) <----> BLL (Web Service) <----> DAL (C# Application) <----> Physical DB (SQL Server 2008)
My question is that, I need some professional coding tips from you guys.
Right now, System is ready with me.
Sample code would be greatly appreciated.
Note : I am using C#.Net (.Net FW 3.5) and SQL Server 2008.
Thanks.
Vijay Jadhav.
|
|
|
|
|
Hi,
I'm using an XmlSerializer and TextReader to read some XML:
XmlSerializer ser = new XmlSerializer(typeof(MyClass));
TextReader tr = new StreamReader(filename);
MyClass myClass = (MyClass)ser.Deserialize(tr);
With this I can read the XML and populate the myClass object with simple string values even when one of the myClass members is a class itself. It all works fine up to a point in my XML file which lists multiple messages so the XML is like this:
<MyClass>
<application>
<name>MyApp</name>
</application>
<messages>
<message>
<value>Error</value>
</message>
<messagegt;
<value>Warning</value>
</message>
</messages>
</MyClass>
I can deserialize the application part of the XML into a class member in my MyClass object but I need to deserialize the messages into a Messages class member which is some sort of collection of messages.
Can anyone help? Is there some collection class I can use that will work?
|
|
|
|
|
Hi
Can anyone tell me how to generate an XML file using a typed dataset?
I have a typed dataset called _WorkStationDataSet. But WriteXml() can not be called direclty from it, I have to create a new instance of it using:
_WorkStationDataSet ds = new _WorkStationDataSet(), but then calling WriteXml() on ds does not create a hierarchical xml file, instead it just puts two lines of xml at the top of the file showing the name of the dataset.
|
|
|
|
|
What I also want to know, is say for instance you have 2 tables; Categories and Products. And the relationship between them is one-to-many (A category can have many products). Is it possible to generate an XML file showing all the different categories as well as the products belonging to them hierarchically?
<Category id=1><br />
<Product id=1><br />
<name>milk</name><br />
<description>white</description><br />
<price>3.00</price><br />
<Product id=2><br />
<name>cola&/name><br />
<description>black&/description><br />
<price>3.00&/price><br />
<Category id=2><br />
<Category id=3>
|
|
|
|
|
Hi
I'm using a typed dataset which was generated for me by adding a new data source via the visual studio wizard. My problem is, when I call the WriteXml
method on my dataset (e.g. dsDemo.WriteXml) it creates an XML file yes, but the only thing in the XML file is the following:
<?xml version="1.0" standalone="yes" ?>
<_Workstation_aXYZDataSet xmlns="http://tempuri.org/_Workstation_aXYZDataSet.xsd" />
Why does it not show all my table data?
|
|
|
|
|
Did you add any data to the dataset?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I've been using this code to produce a string representation of some xml that I output to a webpage:
<br />
XslCompiledTransform transform = new XslCompiledTransform();<br />
transform.Load(XSL);<br />
StringWriter writer = new StringWriter();<br />
transform.Transform(EMailDocument, null, writer);<br />
return xml = writer.ToString();
Now I need to change the code so that instead of a string I get back the output XmlDocument. My first attempt just to get things moving was to pump the output of the above into the LoadXml() method of the XmlDocument but I get errors about matching tags, I suspect because of the whitespace (\r\n etc) that is in the text.
Does anyone have an easy way of transforming a document into another document?
Cheers
Russell
|
|
|
|
|
Russell Jones wrote: Does anyone have an easy way of transforming a document into another document?
It's been a few years but there were methods that returned XmlSource or maybe XmlNode or some such thing in early versions of the BCL. However even if you use something like that with XSLT that is producing illegal XML ( Not well formed ), it will produce a similar error that LoadXML() does.
Russell Jones wrote: but I get errors about matching tags
So I imagine you need to fix your XSLT either way. I've never tried it but if you set the XSLT output type to XML the XSLT processor might error and not even produce the string output.
|
|
|
|
|
i am using this code required result is not obtained
DECLARE @DataColumnListInXML XML
SELECT @DataColumnListInXML='
<columnfeature>
<feature>
<featureid>1
<columns>
<id>1<id>
<id>2
DECLARE @IColumnList int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @IColumnList OUTPUT, @DataColumnListInXML
SELECT featureID,ID FROM OPENXML (@IColumnList, '/ColumnFeature/Feature/Columns',3)
WITH (ID varchar(19),
featureID varchar(19)
)
hi
|
|
|
|
|
I am very new to xml...so please bear that in mind as I ask this question.
I worte a very simple tee menu in xml, and my goal is to transform this to HTML so that it can be viewed through the browser.
I have done some reading on this subject and know that I can use either XSLT or possibly parsing the XML with Windows...but I have not been successful on my own.
Below is a snippet of the xml menu:
<menu><br />
<style>left menu</style> <br />
<br />
<name>BIMI Menu</name> <br />
<br />
<entry><br />
<name>Home</name> <br />
<br />
<url>index.htm</url> <br />
<br />
</entry> <br />
<menu><br />
<name>HBCA</name><br />
<menu><br />
<name>Actuate</name><br />
<menu><br />
<name>Direct Weekly</name><br />
<entry><br />
<name>DR03w - Direct Weekly</name><br />
<url>#</url><br />
</entry><br />
</menu><br />
<menu>
This tree menu is to be 3 levels deep...and I when it is viewed in HTML I want the users to be able to click on the entries to view the next level.
I know I can add customization to this like gif images and expand/collapse, which I can code in javascript....but I can not seem to at least view this menu outside of default xml.
Please assist me...it would be greatly appreciated!
|
|
|
|