|
I am using c# serialisation to write some xml. For some reason the output is not necessarily written in the order it appears in the code.
How can I order the elements?
For example:
[Serializable]
public class Request
{
[XmlElement("Type")]
public string Type
{
get;
set;
}
[XmlElement("Id")]
public int Id
{
get;
set;
}
}
Would write
<Request>
<Id>1</Id>
<Type>Get</Type>
</Request>
(Note this example is very simplified and doesn't actually write it wrongly).
|
|
|
|
|
Fixed it.
It turns out, fields are serialised before properties and my code was actually like this:
[Serializable]
public class Request
{
[XmlElement("Type")]
public string Type
{
get;
set;
}
[XmlElement("Id")]
public int Id;
}
|
|
|
|
|
I have just been successfull at generating an element centric xml query using linq to my sqlserver database. Can someone show me an example how to do it to generate an attribute centric result?
I also am able to save the results to a file on my c drive but need to save it to an xml file in my project.
Thank you in advance.
|
|
|
|
|
I am generating a Excel Sheet(XML SpraedSheet) through XSLT transform.How to password protect the XML SpreadSheet in XSLT.
Is there is any tag to password Protect?
Is there is any other solutions to password protect the XML Spreadsheet?
Best Regards
|
|
|
|
|
It's as if you understand XSLT, and yet somehow have no idea what XML is. How is that possible ?
XML is a string. You can write external code to encode the entire string ( meaning it won't be XML anymore ), or to encode the contents of the nodes. You'd then need corresponding code to decode the information. You can invent a 'password protect tag', but it's plainly not going to alter the fact that all you have is a plain text file.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Good morning.
I am populating a datagridview with a dataset from an XML file.
I now want to write some code to delete a row on the datagridview to simulate a user clicking on the row and hitting the Delete button.
Any ideas on how to accomplish this?
Thank you, WHEELS
|
|
|
|
|
Good morning.
I have the following simple XML file.
<?xml version="1.0" standalone="yes"?>
<SHRPT_SITE>
<RECORD>
<Name>Apps (doc)</Name>
<Address>http:
</RECORD>
<RECORD>
<Name>Internet Services Architecture (arch)</Name>
<Address>http:
</RECORD>
<RECORD>
<Name>iServices Customer Self Service (staff)</Name>
<Address>http:
</RECORD>
</SHRPT_SITE>
I want the user to be able to click a (favorites) button and be able to add a site name and URL to the file. What would be the best code approach to accomplish this?
Thank you, WHEELS
|
|
|
|
|
Use an XmlDocument to create a new record, and then append it to the shrpt_site node.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Is it possible to call a comand line program from within an Xml File Preprocessor. I have a connection string that is encrypted in a settings file and i want to decrypt it before assigning it to the conString value
<configuration>
<appSettings>
<!-- ifdef ${_xml_preprocess} -->
<!-- <add key="conString" value="${connectionStringWithPassowrd}"/> -->
<!-- else -->
<add key="conString" value="connection string"/>
<!-- endif -->
</appSettings>
</configuration>
|
|
|
|
|
No. You should write code to decrypt it in a class and use that to access the values.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi.
How can I group values in "Type" ( xmldatasource - fill dropdownlist with distinct values ) ?
XSL:
<?xml version="1.0"?>
<xsl:transform
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>
<xsl:strip-space elements="*"/>
<xsl:output method="xml"
omit-xml-declaration="yes"
indent="yes"
standalone="yes" />
<xsl:template match="/">
<xsl:for-each select="dataroot">
<xsl:element name="dataroot">
<xsl:for-each select="Table_A">
<xsl:element name="Table_A">
<xsl:attribute name="Type">
<xsl:value-of select="Type"/>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:transform>
XML:
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2009-10-21T09:21:31">
<Table_A>
<ID_I>100085004</ID_I>
<Type>GPS</Type>
<Value>0</Value>
<SDD_Date>1829-06-12T00:00:00</SDD_Date>
</Table_A>
</dataroot>
Thanks in advance !!
modified on Friday, October 23, 2009 3:43 AM
|
|
|
|
|
Clas,
can you use XSLT 2.0 instead 1.0? (If you can control the XSLT engine you use, then switch to SAXON by M. Kaye, from the web-site, you can also download all you need for .NET reuse.)
If so, <xsl:key ...=""> and the so-called Muenchian method is your friend.
All you need to know you will find here:
http://www.jenitennison.com/xslt/grouping/muenchian.html[^]
Best regards,
Stefan
|
|
|
|
|
Hello community,
i am new user and its my first question that i seek an answer or some sort of answer that will help me with my work so please don't judge me
My problem is that i made html page and on that page i have form in witch i insert email/password.I want those informations to be inserted into Xml file file witch i already have in my project.I want this problem to be solved with javascript or jquery.(server environment not client if that is possible).
So if anyone is interested in solving my problem it will be from big help to me.
Thanks.
modified on Monday, October 19, 2009 8:16 AM
|
|
|
|
|
live4u wrote: I want this problem to be solved with javascript or jquery.(server environment not client if that is possible).
Um... I know you're new and all, but you just asked a dumb question. You want to use client side code, but you want it to run on the server ? How does that make sense ?
To manipulate XML, there's almost certainly a DOM implimentation in the framework you're using, but if you want specific code, the ASP.NET forum for ASP.NET or web dev for any other web platform, is the best place to ask this. Although it relates to XML, it's hard to know how to answer based on what you said. XmlDocument class if you're using .NET, otherwise I don't know. But, you can't use javascript or jquery ( which is just a javascript library, it's not a language ) on the server, nor should you want to.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi am a LAMP developer and our team are about to embark on a version 2 of a web based application, with an upgrade of client tier to AJAX. For client-server communication we have narrowed down the options to XML and JSON was wondering what are the benefits and drawbacks of both. Right now am leaning towards JSON?
Regards
|
|
|
|
|
As opposed to embedding an image within a Microsoft Word 2007 document, I have been looking for the possibility of using XML to link to another location on the network where the image files would be stored locally.
Is this possible? If so, would anyone be able to help by pointing me in the direction of learning more knowledge on this subject?
Any and all help is greatly appreciated
jsquires
modified on Friday, October 16, 2009 10:57 AM
|
|
|
|
|
HI,
I HAVE A XML FILE WITH HYPHEN(-) IN SOME ITS ELEMENTS FOR EXAMPLE
<NAME>
<FIRST-NAME>JOHN </FIRST-NAME>
<LAST-NAME>MILLER </LAST-NAME>
<AGE>25 <AGE>
</NAME>
I ALSO HAVE XSD FILE VALIDATING THIS XML FILE AND WHEN I BULKINSERT IT IN MY DATABASE ELEMENT NAMES WITH
HYPHEN ARE NOT INSERTING <FIRST-NAME>JOHN </FIRST-NAME> , <LAST-NAME>MILLER </LAST-NAME>
WHERE AS NON-HYPHEN ELEMENTS <AGE>25 <AGE> INSERTED FINE.
HOW CAN I VALIDTE THE HYPHENATED ELEMENTS WITH MY XSD AND THEN INSERT INTO DATABASE. PLS HELP
sai krishna
|
|
|
|
|
The validation is obviously not a problem - it's that your database doesn't allow/have fields with hyphens? How are you inserting into the database?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
HI STUART DOOTSON , THANKS FOR REPLYING
MY DATABASE IS SQLSERVER AND I AM BULK INSERTING MY XML FILE USING SQLXML3.0 FRAMEWORK . IHAVE A VB SCRIPT LIKE
OBJECT.Execute "MYSCHEMA.XSD" , "MYXMLFILE.xml"
AM ASLO MAPPING MY XML TAGS WITH SQLSERVER TABLE NAME IN MY XSD FILE
<xsd:element name="FIRST-NAME" sql:relation="FIRSTNAME" >
<xsd:complexType>
....................
..........................
</xsd:complexType>
</xsd:element>
sai krishna
|
|
|
|
|
hi,
i don't know if i'm posting at the right forum ....so plz be merciful
i'm not familiar with the SOAP protocol or with the web services....i searched ggogle did'nt foundsomething useful on how to work with web services and implement it in my desktop application or my web application ...so any links would be appreciated
|
|
|
|
|
roba alchab wrote: i'm not familiar with the SOAP protocol or with the web services....i searched ggogle did'nt foundsomething useful on
Are you sure you searched? What about all of these[^]?
|
|
|
|
|
Hi,
I am new to xml,i have create a 3 textbox using xml,and i want to pass the user inputvalue to php variable and insert into db...
how to do this...
<samplefield1fromgroup4 translate="label">
<label>User Name</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</samplefield1fromgroup4>
need help....
|
|
|
|
|
Hi,
please let me know wat are teh requirements required to develop a gaming project in XML....i mean along with XML what other technologies can be used.
|
|
|
|
|