Search Results

Search found 19474 results on 779 pages for 'xml validation'.

Page 12/779 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Python XML + Java XML interoperability.

    - by erb
    Hello. I need a recommendation for a pythonic library that can marshall python objects to XML(let it be a file). I need to be able read that XML later on with Java (JAXB) and unmarshall it. I know JAXB has some issues that makes it not play nice with .NET XML libraries so a recommendation on something that actually works would be great.

    Read the article

  • Validating XML with multiple XSDs in Java

    - by Arian
    Hello! I want to parse an XML file with Java and validate it in the same step against an XSD schema. An XML file may contain content of several schemas, like this: <outer xmlns="my.outer.namespace" xmlns:x="my.third.namespace"> <foo>hello</foo> <inner xmlns="my.inner.namespace"> <bar x:id="bar">world</bar> </inner> </outer> Given a namespace the corresponding xsd file can be provided, but the used namespaces are unknown before parsing. If a schema defines default values for attributes, I also want to know that somehow. I was able to validate a file if the schemas are known, I was able to parse a file without validation and I implemented a LSResourceResolver. However, I can't get all of it working together. How do I have to set up my (SAX) parser?

    Read the article

  • Writing to XML issue Unity3D C#

    - by N0xus
    I'm trying to create a tool using Unity to generate an XML file for use in another project. Now, please, before someone suggests I do it in something, the reason I am using Unity is that it allows me to easily port this to an iPad or other device with next to no extra development. So please. Don't suggest to use something else. At the moment, I am using the following code to write to my XML file. public void WriteXMLFile() { string _filePath = Application.dataPath + @"/Data/HV_DarkRideSettings.xml"; XmlDocument _xmlDoc = new XmlDocument(); if (File.Exists(_filePath)) { _xmlDoc.Load(_filePath); XmlNode rootNode = _xmlDoc.CreateElement("Settings"); // _xmlDoc.AppendChild(rootNode); rootNode.RemoveAll(); XmlElement _cornerNode = _xmlDoc.CreateElement("Screen_Corners"); _xmlDoc.DocumentElement.PrependChild(_cornerNode); #region Top Left Corners XYZ Values // indent top left corner value to screen corners XmlElement _topLeftNode = _xmlDoc.CreateElement("Top_Left"); _cornerNode.AppendChild(_topLeftNode); // set the XYZ of the top left values XmlElement _topLeftXNode = _xmlDoc.CreateElement("TopLeftX"); XmlElement _topLeftYNode = _xmlDoc.CreateElement("TopLeftY"); XmlElement _topLeftZNode = _xmlDoc.CreateElement("TopLeftZ"); // indent these values to the top_left value in XML _topLeftNode.AppendChild(_topLeftXNode); _topLeftNode.AppendChild(_topLeftYNode); _topLeftNode.AppendChild(_topLeftZNode); #endregion #region Bottom Left Corners XYZ Values // indent top left corner value to screen corners XmlElement _bottomLeftNode = _xmlDoc.CreateElement("Bottom_Left"); _cornerNode.AppendChild(_bottomLeftNode); // set the XYZ of the top left values XmlElement _bottomLeftXNode = _xmlDoc.CreateElement("BottomLeftX"); XmlElement _bottomLeftYNode = _xmlDoc.CreateElement("BottomLeftY"); XmlElement _bottomLeftZNode = _xmlDoc.CreateElement("BottomLeftZ"); // indent these values to the top_left value in XML _bottomLeftNode.AppendChild(_bottomLeftXNode); _bottomLeftNode.AppendChild(_bottomLeftYNode); _bottomLeftNode.AppendChild(_bottomLeftZNode); #endregion #region Bottom Left Corners XYZ Values // indent top left corner value to screen corners XmlElement _bottomRightNode = _xmlDoc.CreateElement("Bottom_Right"); _cornerNode.AppendChild(_bottomRightNode); // set the XYZ of the top left values XmlElement _bottomRightXNode = _xmlDoc.CreateElement("BottomRightX"); XmlElement _bottomRightYNode = _xmlDoc.CreateElement("BottomRightY"); XmlElement _bottomRightZNode = _xmlDoc.CreateElement("BottomRightZ"); // indent these values to the top_left value in XML _bottomRightNode.AppendChild(_bottomRightXNode); _bottomRightNode.AppendChild(_bottomRightYNode); _bottomRightNode.AppendChild(_bottomRightZNode); #endregion _xmlDoc.Save(_filePath); } } This generates the following XML file: <Settings> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> </Settings> Which is exactly what I want. However, each time I press the button that has the WriteXMLFile() method attached to it, it's write the entire lot again. Like so: <Settings> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> <Screen_Corners> <Top_Left> <TopLeftX /> <TopLeftY /> <TopLeftZ /> </Top_Left> <Bottom_Left> <BottomLeftX /> <BottomLeftY /> <BottomLeftZ /> </Bottom_Left> <Bottom_Right> <BottomRightX /> <BottomRightY /> <BottomRightZ /> </Bottom_Right> </Screen_Corners> </Settings> Now, I've written XML files before using winforms, and the WriteXMLFile function is exactly the same. However, in my winform, no matter how much I press the WriteXMLFile button, it doesn't write the whole lot again. Is there something that I'm doing wrong or should change to stop this from happening?

    Read the article

  • XML Signature in a Web application

    - by OpenDevSoft
    Hi, We are developing an e-Banking web application for a small bank (up to 20000 clients/users). We have to implement digital signatures with X509 certificates (issued by CA on USB tokens) for signing payment information. We tried using CAPICOM but it seems that it is not working well with Windows Vista (have not tried it with Win 7). The other problem is that core banking system can process only Xml digital signatures, so we have to sign XML documents (not just a bulk-formatted text data like with CAPICOM and Win32 Crypto API). So my questions here are: Does anyone of you have similar problem and how did they solved it? Is there a plug-in, library, component or external tool (for Internet Explorer and/or Fire Fox) that supports XML Digital Signatures in a web application? Can you please recommend some of these products and write something about your experience with them? Thank you very much.

    Read the article

  • parse Linq To Xml with attribute nodes

    - by Manoj
    I am having xml with following structure <ruleDefinition appId="3" customerId = "acf"> <node alias="element1" id="1" name="department"> <node alias="element2" id="101" name="mike" /> <node alias="element2" id="102" name="ricky" /> <node alias="element2" id="103" name="jim" /> </node> </ruleDefinition> Here nodes are differentiated using alias and not with node tag. As you can see top level node element1 has same node name "node" as element2. I want to parse this XML based on attribute alias. What should be the Linq-To-Xml code (using C#)to acheive this?

    Read the article

  • XML deserialization doesn't read in second level

    - by Andy
    Sorry if the title doesn't make much sense, but I'm not too familiar with the terminology. My question is: I have a config.xml file for a program I'm working on. I created an xsd file by 'xsd.exe config.xml'. I then took this xsd and added it to the solution in visual studio. My last step used a program called xsd2code that turned that xsd file into a class I can serialize too. The problem is it doesn't read more then a layer deep in the xml tree. By this I mean the elements in the root node get deserialized into my object, but those that are in a node inside the root node are not. I found this out by putting a breakpoint after the deserialization and looking at my object. Any Ideas? Let me know if this needs some clarification or you need a snippet of something.

    Read the article

  • Element Based XML Parsing

    - by demos
    I have an XML document which reads like this: <xml> <web:Web> <web:Total>4000</web:Total> <web:Offset>0</web:Offset> </web:Web> </xml> my question is how do I access them using a library like BeautifulSoup in python? xmlDom.web["Web"].Total ? does not work?

    Read the article

  • Element Based XML Parising

    - by demos
    I have an XML document which reads like this: <xml> <web:Web> <web:Total>4000</web:Total> <web:Offset>0</web:Offset> </web:Web> </xml> my question is how do I access them using a library like BeautifulSoup in python? xmlDom.web["Web"].Total ? does not work?

    Read the article

  • Getting multiple data items in an element with linq to xml

    - by Maestro1024
    Getting multiple data items in an element with linq to xml I have an xml file like this <TopLevel> <Inside> Jibba </Inside> <Inside> Jabba </Inside> </TopLevel> I was given said xml and and want to get all the elements. Here is the code I have. var q = from c in loaded.Descendants("TopLevel") select (XElement)c.Element("Inside"); I tried c.Elements but that did not work. What do I need to do to get all of the internal elements? This code just gets the first "Inside" tag.

    Read the article

  • How to modify by loading and saving the same xml file

    - by cynthia hong
    I have a problem with modifying xml file when i first load and then save it with same file path and name. Below is my code. The error is "Access to the path C:\MyApp\Web.config is denied. If i change the path of the xdoc.Save to be different from xdoc.Load, then it will be ok. What is your recommandation to solve this problem? If possible, i need to modify the existing xml file(meaning xml file for loading and saving is the same path). XmlDocument xdoc = new XmlDocument(); xdoc.Load(@"C:\\MyApp\\Web.config"); XmlNode xn = xdoc.SelectSingleNode("//configuration/MyProvider"); XmlElement el = (XmlElement)xn; el.SetAttribute("defaultProvider", "MyCustomValue"); xdoc.Save(@"C:\\MyApp\\Web.config"); Thanks in advance.

    Read the article

  • Linq to xml not able to add new elements

    - by Fore
    We save our xml in a "text" field in the database. So first I check if it exist any xml, if not I create a new xdocument, fill it with the necessary xml. else i just add the new element. Code looks like this: XDocument doc = null; if (item.xmlString == null || item.xmlString == "") { doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XElement("DataTalk", new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance"), new XAttribute(XNamespace.Xmlns + "xsd", "http://www.w3.org/2001/XMLSchema"), new XElement("Posts", new XElement("TalkPost")))); } else { doc = XDocument.Parse(item.xmlString); } This is working alright to create a structure, but then the problem appears, when I want to add new TalkPost. I get an error saying incorrectly structured document. The following code when adding new elements: doc.Add(new XElement("TalkPost", new XElement("PostType", newDialog.PostType), new XElement("User", newDialog.User), new XElement("Customer", newDialog.Customer), new XElement("PostedDate", newDialog.PostDate), new XElement("Message", newDialog.Message)));

    Read the article

  • OnSelectedIndexChange only fires on second click when using custom page validation script

    - by Kris P
    Okay.. this is hard to explain, so here it goes. I have an update panel which contains a number of controls. The update panel is triggered by the OnSelectedIndexChanged event of a dropdownlist called: ddlUSCitizenshipStatus. It works as expected when I selected a new item. However, if I leave ddlUSCitizenshipStatus with the default value, and then click "submit" button on the page, the requiredfieldvalidators say there is an error on ddlUSCitizenshipStatus (which it should, as I never selected a value). So I then choose a value, the error message goes away on ddlUSCitizenshipStatus, however the updatepanel does not refresh. I've debugged this locally and the OnSelectedIndexChanged event for ddlUSCitizenshipStatus does not fire. If I choose an item in the ddlUSCitizenshipStatus list a second time, the OnSelectedIndexChanged server event fires and the update panel refreshes and works as expected. The issue is, I have to select an item in ddlUSCitizenshipStatus twice, after failed validation, before the updatepanel it's sitting in updates. The submit button on the page looks like this: <asp:LinkButton ID="btnSubmitPage1" runat="server" CssClass="continueButton" OnClick="btnSubmitPage1_Click" CausesValidation="true" OnClientClick="javascript: return ValidatePage();" /> If I remove my custom OnClientClick script, making the submit button look like this: <asp:LinkButton ID="btnSubmitPage1" runat="server" CssClass="continueButton" OnClick="btnSubmitPage1_Click" CausesValidation="true" ValidationGroup="valGrpAdditionalInformation" /> The dropdownlist, update panel, and reguiredfieldvalidator all work as expected. However, I need to run that custom "ValidatePage()" script when the button is clicked. Below is what my ValidatePage script looks like. I've been troubleshooting this for more hours than I can count.... I hope someone is able to help me. Please let me know if you can figure out why ddlUSCitizenshipStatus doesn't update the updatepanel until the second click after a failed validation. function ValidatePage() { var blnDoPostBack = true; if (typeof(Page_ClientValidate) == 'function' ) { //Client side validation can occur, so lets do it. //Validate each validation group. for( var i = 0; i < Page_ValidationSummaries.length; i++ ) Page_ClientValidate( Page_ValidationSummaries[i].validationGroup.toString() ); //Validate every validation control on the page. for (var i = 0; i < Page_Validators.length; i++) ValidatorValidate(Page_Validators[i]); //Figure out which validation groups have errors, store a list of these validation groups in an array. var aryValGrpsWithErrors = []; for( var i = 0; i < Page_Validators.length; i++ ) { if( !Page_Validators[i].isvalid ) { //This particular validator has thrown an error. //Remeber to not do a postback, as we were able to catch this validation error client side. blnDoPostBack = false; //If we haven't already registered the validation group this erroring validation control is a part of, do so now. if( aryValGrpsWithErrors.indexOf( Page_Validators[i].validationGroup.toString() ) == -1 ) aryValGrpsWithErrors[aryValGrpsWithErrors.length++] = Page_Validators[i].validationGroup.toString(); } } //Now display every validation summary that has !isvalid validation controls in it. for( var i = 0; i < Page_ValidationSummaries.length; i++ ) { if( aryValGrpsWithErrors.indexOf( Page_ValidationSummaries[i].validationGroup.toString() ) != -1 ) { Page_ValidationSummaries[i].style.display = ""; document.getElementById( Page_ValidationSummaries[i].id.toString() + "Wrapper" ).style.display = ""; } else { //The current validation summary does not have any error messages in it, so make sure it's hidden. Page_ValidationSummaries[i].style.display = "none"; document.getElementById( Page_ValidationSummaries[i].id.toString() + "Wrapper" ).style.display = "none"; } } } return blnDoPostBack; }

    Read the article

  • Excel 2010 data validation warning (compatibility mode)

    - by Madmanguruman
    We have some legacy worksheets that were created in Excel 2003, which are used by LabVIEW-based test automation software. The current LabVIEW software can only handle the legacy .xls format, so we're forced to keep these worksheets as-is for the time being. We've migrated to Office 2010 and when working with these worksheets, I see this warning: "The following features in this workbook are not supported by earlier versions of Excel. These features may be lost or degraded when you save this workbook in the currently selected file format. Click Continue to save the workbook anyway. To keep all of your features, click Cancel and then save the file in one of the new file formats." "Significant loss of functionality" "One or more cells in this workbook contain data validation rules which refer to values on other worksheets. These data validation rules will not be saved." When I click 'Find', some cells that do indeed have validation rules are highlighted, but those rules are all on the same worksheet! We're using simple list-based validation, with some cells off to the side containing the valid values (for example, cell B4 has a List with Source "=$D$4:$E$4") This makes no sense to me whatsoever. One, the workbook was created in Excel 2003, so obviously we couldn't implement a feature that doesn't exist. Secondly, the modifications we're making don't involve changing the validation rules at all. Thirdly, the complaint that Excel is making is incorrect! All of the rules are on the same worksheet as the target. As if the story wasn't bizarre enough: I went ahead and saved the worksheet with Excel 2010. I then went to an old computer back in the lab and opened the document with Excel 2003. Guess what - the validations were untouched! My questions are: is this a legitimate bug in Excel 2010, or is this some exotic error in the legacy .xls worksheet that is confusing the heck out of Excel 2010? Has anyone else observed this issue working in compatibility mode?

    Read the article

  • Serializing a list of Key/Value pairs to XML

    - by Slauma
    I have a list of key/value pairs I'd like to store in and retrieve from a XML file. So this task is similar as described here. I am trying to follow the advice in the marked answer (using a KeyValuePair and a XmlSerializer) but I don't get it working. What I have so far is a "Settings" class ... public class Settings { public int simpleValue; public List<KeyValuePair<string, int>> list; } ... an instance of this class ... Settings aSettings = new Settings(); aSettings.simpleValue = 2; aSettings.list = new List<KeyValuePair<string, int>>(); aSettings.list.Add(new KeyValuePair<string, int>("m1", 1)); aSettings.list.Add(new KeyValuePair<string, int>("m2", 2)); ... and the following code to write that instance to a XML file: XmlSerializer serializer = new XmlSerializer(typeof(Settings)); TextWriter writer = new StreamWriter("c:\\testfile.xml"); serializer.Serialize(writer, aSettings); writer.Close(); The resulting file is: <?xml version="1.0" encoding="utf-8"?> <Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <simpleValue>2</simpleValue> <list> <KeyValuePairOfStringInt32 /> <KeyValuePairOfStringInt32 /> </list> </Settings> So neither key nor value of the pairs in my list are stored though the number of elements is correct. Obviously I am doing something basically wrong. My questions are: How can I store the key/value pairs of the list in the file? How can I change the default generated name "KeyValuePairOfStringInt32" of the elements in the list to some other name like "listElement" I'd like to have?

    Read the article

  • PHP Object as XML Document

    - by Sam McAfee
    What is the best way to take a given PHP object and serialize it as XML? I am looking at simple_xml and I have used it to parse XML into objects, but it isn't clear to me how it works the other way around.

    Read the article

  • Java: Moving Away from XML Encode

    - by bguiz
    Hi, We have this software which loads various bits of data from files that are written using XMLEncode (serialization using XML). We want to migrate from that to our own proprietary file format (can be XML based). Is there a automated way to achieve this initial conversion, without having to perform a deserialization, and then write those objects out in the new format? XMLEncode format --> New proprietary file format Thanks!

    Read the article

  • Complex sorting of XML subnodes in .Net3.5 onwards

    - by MicMit
    XML structure expressed in Xpath kind of Records/Record/Actions/Action/ActionDate the other node on the same level Records/Record/Actions/Action/CTCDate Is there easy or not easy way to sort it on "order by ActionDate,CTCDate" ( in SQL notation ), but per Actions for each selected Record when we iterate somehow ( not per XML file ). File around 50M

    Read the article

  • Best way to get database result as XML?

    - by John
    I am querying a database and getting the result set as an arraylist. I would like to return this list as XML, but not sure how to do it. Does anyone have an example of returning a result set as XML and is using an Arraylist the best way to do this?

    Read the article

  • How to parse deeply nested using LINQ to XML

    - by Picflight
    How do I parse the following XML using LINQ? I need to insert into a database table OrderNumber, ShipAddress, ShipCity, ShipState for each Order & OrderCancelled. Then in a separate table I need to insert OrderId from the Returns/Amount section. <!-- language: lang-xml --> <?xml version="1.0" encoding="utf-8"?> <OrdersReport Date="2012-08-01"> <Client> <ClientId>1</ClientId> <Orders> <Order> <OrderNumber>1</OrderNumber> <ShipAddress>123 Main St.</ShipAddress> <ShipCity>MyCity</ShipCity> <ShipState>AZ</ShipState> </Order> <Order> <OrderNumber>2</OrderNumber> <ShipAddress>111 Main St.</ShipAddress> <ShipCity>OtherCity</ShipCity> <ShipState>AL</ShipState> </Order> <OrderCancelled> <OrderNumber>3</OrderNumber> <ShipAddress>111 Main St.</ShipAddress> <ShipCity>OtherCity</ShipCity> <ShipState>AL</ShipState> </OrderCancelled> </Orders> <Returns> <Amount> <OrderId>2</OrderId> <OrderId>3</OrderId> </Amount> </Returns> </Client> <Client> <ClientId>2</ClientId> <!-- Same Tree structure as Client 1 --> </Client> </OrdersReport> Not sure why the XML is not showing red and blue colors and not indenting properly. :-(

    Read the article

  • How to rebuild C# Class from XML

    - by mcass20
    I would like to save an instance of a c#.NET class in SQL for later retrieval. I am able to use LINQ to SQL to add a record complete with all the xml that makes up the class. Now how do I retrieve that xml and reconstruct the class object instance?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >