FAQ Database Discussion Community


Error during deserializing XML

c#,xml,serialization,deserialization
Class that I am serializing: public class StyleProperties { [XmlAttribute] public string Name; [XmlAttribute] public string Description; [XmlAttribute] public StyleType Type; public ShapeStyleProperties ShapeStyle; public TextStyleProperties TextStyle; } Part that is responsible for serializing data: XmlSerializer serializer = new XmlSerializer(typeof(StyleProperties)); PPT.Presentation pres = Globals.ThisAddIn.Application.ActivePresentation; CustomXMLParts parts = pres.CustomXMLParts; //var serializer...

group siblings by identifying the first node of a certain type in sequence

xml,xslt,xpath
Not sure if that description is the best...but given this xml: <?xml version="1.0"?> <root> <type1 num="1" first="1"/> <type1 num="2" /> <type2 num="3" /> <type2 num="4" /> <type1 num="5" first="2"/> <type1 num="6" /> <type2 num="7" /> <type2 num="8" /> <type1 num="9" first="3"/> <type1 num="10" /> <type2 num="11" /> <type2 num="12" />...

Xml schema regex to not allow white spaces alone

regex,xml,xsd
In xml, i have a tag say <membercode> The regex pattern for the field currently is <xs:pattern value="[a-zA-Z0-9\s]{1,3}" /> The membercode must accept values as follows: 1) "XY" -> pass 2) "XY " -> pass 3) " " -> i need to have this failed. but it is getting passed....

Update SQL Server table using XML data

sql-server,xml
From my ASP.Net application I am generating XML and pass it as input data to stored procedure as below, <Aprroval> <Approve> <is_nb_approved>false</is_nb_approved> <is_approved>true</is_approved> <is_submitted>true</is_submitted> <UserId>35</UserId> <ClientId>405</ClientId> <taskDate>2015-05-23T00:00:00</taskDate> </Approve> <Approve> <is_nb_approved>false</is_nb_approved> <is_approved>true</is_approved>...

XML-XSLT-XPATH : How to convert multiple XML elements to a string, separated by semicolon

xml,xslt,xpath,xslt-2.0
I have just demonstrated my question as an input and output format as below. I have an input as xml document which consist of following data <Users> <user> <name>Mark Curtain</name> <email>[email protected]</email> <username>mark</username> </user> <user> <name>Zuke Gossip</name> <email>[email protected]</email> <username>zuke</username> </user> <user> <name>Villan Kiosk</name> <email>[email protected]</email>...

ImageView inside scrollview (Android)

android,xml
I can't seem to be able to set my imageView to fill up the whole space (view) of my button. I have button that has a white space as background. Please take a look at my sample My code: <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" > <ScrollView android:id="@+id/scroll" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout android:id="@+id/relativeLayout1"...

Get XML node value when previous node value conditions are true (without looping)

xml,vb.net,linq-to-xml
Sample XML - <?xml version="1.0"?> <Root> <PhoneType dataType="string"> <Value>CELL</Value> </PhoneType> <PhonePrimaryYn dataType="string"> <Value>Y</Value> </PhonePrimaryYn> <PhoneNumber dataType="string"> <Value>555-555-5554</Value> </PhoneNumber> <PhonePrimaryYn dataType="string"> <Value>Y</Value> </PhonePrimaryYn> <PhoneType dataType="string"> <Value>HOME</Value> </PhoneType>...

Roku animation using animated sprites, how to create the tedious xml

xml,animation,sprite-sheet,roku,brightscript
I made a simple java script code to create the sprite sheet xml for the sprite animation in roku written in brightscript. Is there an easier way to just pass in the sheet and let it figure out the dimensions of the frame? That would be cool. I learnt about...

tcl tdom parsing failed due to special charecters in xml tags

xml,tcl,tdom
I am trying to remove some special characters which was existed in XML tags, we can use some regsubs or string map function to eliminate XML special chars in tagged text, But It is lengthy/time consuming process because our log file was very huge around ~25 MB. Is there any...

XML, XSL namespaces

xml,xslt,namespaces
I'm new to XML especially namespaces. I made all the documents and everything seems to work fine, but I don't know whether I'm really using namespaces (which is requirement). Except that my html file are not valid because off this: "Attribute xmlns:xsi not allowed here." and "Attribute xmlns:xslformatting not allowed...

Clean and convert HTML to XML for BaseX

html,xml,converter,xquery,basex
I would like to run some XQuery commands using BaseX over an HTML source that may be full of <script>, <style> nodes that must be removed and also unclosed tags (<br>, <img>) that must have a pair. (for example the dirty source of this page ) "Converting HTML to XML"...

Transform XML to another XML using XSL based on some condition

xml,xslt
I have an XML - <root> <gereratorList> <generator> <id>1</id> <A>123</A> </generator> <generator> <id>10</id> <A>456</A> </generator> <generator> <id>111</id> <A>789</A> </generator> </gereratorList> </root> I want to transform this XML into another XML through XSL. The resulting XML should be something like this - <parent> <child> <test>456</test> <child> </parent> But I am...

Adding a child attribute to the parent element in xslt 1.0

xml,xslt,xpath,xslt-1.0
I have multiple elements that contain an uniqueId(generated and stored in a variable). I have recursively added the element(object class=Bundle with unique id ) with the xsl as follows <xsl:template match="visualChildren"> <object class="Set" > <installChildren> <xsl:call-template name="Bundle"> <xsl:with-param name="i" select="1"/> <xsl:with-param name="limit" select="4" /> </xsl:call-template> </installChildren> </object> </xsl:template> <xsl:template name="Bundle">...

Collect strings after a foreach loop

c#,xml,foreach
Is it possible to collect the strings after a foreach loop? For example: StringCollection col = new StringCollection(); XmlNodeList skillNameNodeList=SkillXML.GetElementsByTagName("name"); foreach (XmlNode skillNameNode in skillNameNodeList) { skillsName=skillNameNode.Attributes["value"].Value; } col.Add(skillsName); //Return System.Collections.Specialized.StringCollection I want to collect each skillsName and put them in a collection or a list so that I can...

Chunking XML with XMLStreamReader failing

java,xml,jaxb,stax
I am trying to chunk out a big XML into smaller pieces with StAX and JAXB. Here is the sample XML that I am working on: <asset> <entity> <record> <field> <id>remarks</id> <value>ready to test1</value> </field> </record> <record> <field> <id>input_quarter</id> <value>Jun-Sep</value> </field> </record> </entity> </asset> I want to read on record...

Reading data from an XML File Using R

xml,r
From reading through, then trying a few previous examples on StackOverflow related to reading an XML file in R, it seems that due to the “jagged” nature of the following file I can’t use XPath related methods. https://www.dropbox.com/s/jz8sj2fifuobkva/Data.xml?oref=e&n=305307914 Therefore, it seems I need to use a combination of xmlToList() and...

Python Resize Multiple images ask user to continue

python,xml,image,resize
I'm trying to make a script that resize multiple or a single image based on a data pulled from XML. My question is if i have multiple images how can I print out a qusetion like "There are more than 1 image do you wish to resize image 2 also?......

xpath query seem to be failing

xml,xpath
Can someone tell me the reason for the failure of this xpath query: //Pages/*[(name() = 'Home') or following-sibling::Home] on this xml structure: <Pages> <copyright>me inc. 2015,</copyright> <author>Me</author> <lastUpdate>2/1/1999</lastUpdate> <Home>--------------------</Home> <About>--------------------</About> <Contact>------------------</Contact> </Pages> only returned copyright element, which is against my targets (To grab all element between Pages and...

simplexml_load_file to file creating an empty file

php,xml
I'm taking an XML file from Amazon and trying to save it to a file. $xml = simplexml_load_file($signedUrl); $file = "c:/wamp/www/products.xml"; file_put_contents($file, $xml); This creates an empty file. Why?...

What is the xpath for retrieving all attribute nodes (whatever be the attributes name) with a specified value?

java,xml,xpath
Following is a sample xml. <library> <book id="aaa"> <title id="bbb">Harry Potter and the Half Blood Prince</title> <author id="ccc" ref="zzz"/> </book> <book id="ddd"> <title id="eee">Harry Potter and the Philosophers Stone</title> <author id="fff" ref="zzz"/> </book> <author-details id="zzz"> <firstName id="ggg">Joanne</firstName> <lastName id="hhh"/>Rowling</lastName> </author-details> </library> There are many more books in this...

R readHTMLTable failed to load external entity [duplicate]

xml,r,connection
This question already has an answer here: R Error using readHTMLTable 2 answers When I run the line on my laptop, table500 <- readHTMLTable('http://en.wikipedia.org/wiki/List_of_S%26P_500_companies')[[1]] it gets the data. When I run it on my desktop, I receive the error Error: failed to load external entity "http://en.wikipedia.org/wiki/List_of_S%26P_500_companies". So I'm guessing...

XElement.Value is stripping XML tags from content

c#,.net,xml,xml-parsing,xelement
I have the following XML: <Message> <Identification>c387e36a-0d79-405a-745c-7fc3e1aa8160</Identification> <SerializedContent> {"Identification":"81d090ca-b913-4f15-854d-059055cc49ff","LogType":0,"LogContent":"{\"EntitiesChanges\":\" <audit> <username>acfc</username> <date>2015-06-04T15:15:34.7979485-03:00</date> <entities> <entity> <properties> <property> <name>DepId</name> <current>2</current> </property>...

Remove an XML node by its content

c#,xml
I Have a XML file that I want remove a node that it's content is 'test'. I search entire Google, so doesn't help me or I can't get my answer. The XML file content is shown below: <?xml version="1.0" encoding="utf-8"?> <parent> <child>C#</child> <child>VB</child> <child>VB.net</child> <child>F#</child> <child>C++</child> <child>C</child> <child>Ruby</child> <child>Pascal</child> <child>test</child>...

Altering XML file format in C#

c#,xml,formatting
I have a program in Visual Studio which gives the output in an XML file. It looks like so: <?xml version="1.0" encoding="utf-8"?> <leaCEDS> <district> <leaID>01</leaID> <name>Alachua</name> <organizationType>LEA</organizationType> <streetLine1>620 E University Ave</streetLine1> <city>Gainesville</city> <stateProvince>FL</stateProvince> <postalCode>326015448</postalCode> <county>Alachua</county>...

Ruby on Rails posting to an API using javascript via a proxy

javascript,ruby-on-rails,ruby,xml,api
I'm very new to Ruby on Rails and I'm hoping this will be a quick fix. I have a very simple form (firstname, surname, email) that needs to post XML to an API on another domain. Everything on our site is clientside javascript so I would like to post to...

XSLT How to remove style from div and td tags

xml,xslt
I am new to XSLT. I got stuck while removing style attributes from div, td or li tags. Input XML: <?xml version="1.0" encoding="UTF-8"?> <div xmlns="http://www.w3.org/1999/xhtml"> <table style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; WIDTH: 606px; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word; TABLE-LAYOUT: fixed; BORDER-TOP: medium none; BORDER-RIGHT: medium none" class="MsoNormalTable msoUcTable" tabIndex="-1" border="1"...

Java XPath returns single result instead of NodeSet

java,xml,dom,xpath
I am trying to create an XPath expression in Java (8, default XPath implementation). I am doing the following: Object res = xpath.evaluate("(//*[local-name()='PartyId'])", requestDom, XPathConstants.NODESET); I have multiple PartyId nodes in the document at the same level, because it's parent is repeating. I got my result, but only a single...

Add XElement dynamically using loop in MVC 4?

c#,xml,asp.net-mvc-4,for-loop
i will like to add the Xelement in Xdocument but how can i add in dynamically using loop? I need to capture the user multiple answer and generate the Xelement dynamically. Please guide me or provide any hint. Thanks alot! [HttpPost] public ActionResult SURV_Answer_Submit(List<AnswerQuestionViewModel> viewmodel, int Survey_ID, string Language) {...

How to get xml attribute and values using JAXB

xml,parsing,jaxb
I am new in Jaxb i have one xml file which contain many attribute so i want the attribute with value My XMl <message_mapping> <message Rtype="DIAGNOSTIC" direction="2" name="Diagnostic" mode=""> <field tag="USERNAME" source="I" tranData="username" required="false" dataType="string" defaultValue="" /> <field tag="PASSWORD" source="I" tranData="password" required="true" dataType="string" defaultValue="" /> <field tag="LOCALDATETIME" source="E" tranData="trxDateTime" required="true"...

Converting XSD 1.1 to 1.0 - Validation Error

xml,xsd
When I try to validate this XSD: <xs:group name="ValidityDateGroup"> <xs:annotation> <xs:documentation>Reusable element group to be used where Valid From/Until needs to be captured in xs:date format</xs:documentation> </xs:annotation> <xs:all> <xs:element minOccurs="0" name="ValidFrom" type="xs:date"/> <xs:element minOccurs="0" name="ValidUntil" type="xs:date"/> </xs:all> </xs:group> <xs:complexType name="NameType"> <xs:choice maxOccurs="unbounded" minOccurs="0">...

finding file in root of wpf application

c#,xml,wpf,visual-studio,relative-path
I'm trying to load a file with pack://application: The file is situated in the root of my project but I keep getting a null reference error. However When I do an absolute reference it finds the file and loads just fine. What am I missing here? This doesn't work var...

xml.etree.ElementTree.Element.remove not removing all elements

python,xml,elementtree
Please see the following code: import xml.etree.ElementTree as ET for x in ("<a><b /><c><d /></c></a>", "<a><q /><b /><c><d /></c></a>", "<a><m /><q /><b /><c><d /></c></a>"): root = ET.fromstring(x) for e in root: root.remove(e) print(ET.tostring(root)) I expect it to output <a></a> in all instances but instead it gives: b'<a><c><d /></c></a>' b'<a><b /></a>'...

How to parse comment from XML with XMLEventReader?

java,xml,xml-parsing
I am parsing an incoming XML file with an XMLInputFactory like the following. How do I get the text out of an XML comment? I know how to detect it, but, not get the text out XMLInputFactory inputFactory = XMLInputFactory.newInstance(); FileInputStream fis = new FileInputStream(incomingFile); XMLEventReader eventReader = inputFactory.createXMLEventReader(fis); while...

Convert meters to foot in xml data via xsl transformation

xml,xslt,openstreetmap
I would like to modify my xml file by converting some values ([email protected]) from meter to foot. I am a newbie to xml and this should be no problem for one of you. The formular is: 1 meter are 3.2808 feet I want to convert the attribute value of node/[email protected]

Javascript - accessing an object with duplicate names

javascript,arrays,xml,object
I have an XML file that I read in to a Javascript object. This is called jsonXML. I can see the object in its entirety in the console when I log it. It is a pretty complex object with a lot of layers and duplication. I need to access some...

HTMLPurifier without XML declaration

php,xml,htmlpurifier
I am using HTMLPurifier on PHP to clean some dirty HTML, as follows: $H=new HTMLPurifier() $content_text_fixHTML = $H->purify($content_text); Note: Omited encoding set up, because it is UTF-8 But, it will output the XML encoding declaration at the top. <?xml encoding="utf-8" ?> I do not want it. How do I prevent...

XML values of the same attribute in different elements cannot repeat

xml,xsd
In my C# application I use an XSD file to validate XML files. Is there any way to include in XSD file a prevention from repeating values of the Reference_number attribute in different elements? <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Items"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Item"> <xs:complexType> <xs:sequence>...

How to get xml Nodes which are in lower case using XSLT 1.0

xml,xslt,xpath,xslt-1.0
I need to get XML nodes which are in lower case and values of it using XSLT 1.0 and display the output as XML <main> <ACAT>Cat Name A </ACAT> <bcat>Cat Name b </bcat> <ccat>Cat Name c </ccat> <dcat>Cat Name d </dcat> <ECAT>Cat Name E </ECAT> <fcat>Cat Name f </fcat> </main>...

Remove XML Node text using XSLT

xml,xslt,xslt-2.0
I need to modify xml document with XSLT. what I need is to remove some node name from xml document. Example: <link ref="www.facebook.com"> <c type="Hyperlink">www.facebook.com<c> </link> I need to convert this xml as follows (remove the <c> node and attribute form xml), <link ref="www.facebook.com"> www.facebook.com </link> I tried to do...

XML Post from form using curl PHP

php,xml,curl
What is the best way to post XML from a form using Curl. I have a HTML Form and i post the data to a new php page and all the fields are collected. How do i collect these fields in XML Format. I can process it from a xml...

Sequence number for static and dynamic rows in XSLT 2.0

xml,xslt-2.0
I'm trying to generate sequence number for my input xml with some static and dynamic rows combination. input xml: (Edited) <data> <oldLine>dat1</oldLine> <modLine>dat2</modLine> <line>para1</line> <line>para2</line> <line>para3</line> </data> <data> <oldLine>dat3</oldLine> <modLine>dat4</modLine> <line>para4</line> <line>para5</line> </data> I need to add three fixed records after every "data" tag in the loop...

How to use XDocument to get attributes and add them to a List

c#,xml,winforms,list
I am trying to load data from an XML file and add it to a List. The XML file looks like this: and this is my code: public void LoadPayments(List<List<string>> list1, List<List<string>> list2) { try { if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RentData.xml"))) { int count = 0; XDocument doc; using (var reader =...

Error when building an XDocument

c#,xml,linq,xpath,linq-to-xml
Using the following example xml containing one duplicate: <Persons> <Person> <PersonID>7506</PersonID> <Forename>K</Forename> <Surname>Seddon</Surname> <ChosenName /> <MiddleName /> <LegalSurname /> <Gender>Male</Gender> </Person> <Person> <PersonID>6914</PersonID> <Forename>Clark</Forename> <Surname>Kent</Surname> <ChosenName>Clark</ChosenName> <MiddleName />...

odoo v8 - Field(s) `arch` failed against a constraint: Invalid view definition

python,xml,view,odoo,add-on
I want to create a new view with a DB-view. When I try to install my app, DB-view was created then I get error: 2015-06-22 12:59:10,574 11988 ERROR odoo openerp.addons.base.ir.ir_ui_view: Das Feld `datum` existiert nicht Fehler Kontext: Ansicht `overview.tree.view` [view_id: 1532, xml_id: k. A., model: net.time.overview, parent_id: k. A.] 2015-06-22...

Retrieving an XML node value with TSQL?

sql-server,xml,tsql,soap
What am I not getting here? I can't get any return except NULL... DECLARE @xml xml SELECT @xml = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <webregdataResponse> <result>0</result> <regData /> <errorFlag>99</errorFlag> <errorResult>Not Processed</errorResult> </webregdataResponse> </SOAP-ENV:Body>...

Can I create a macro or shortuct for a step of XPath in XQuery?

xml,xpath,macros,xquery
Do we have Macros in XQuery? If yes, could you please give an example of their usage. I have the following code let $x := //price/ancestor::* Can I someway, using macros or other things write it as follows: let $x := //price/outward So, the outward should mean ancestor::*...

Concatenate two XML templates in Python

python,xml,elementtree
I have two XML template needed to be added when certain conditions are met. I concatenate doesn't seem to handle them properly. template1 = \ ''' <ParentTag> <orders orderid="%s"> <unitprice>%s</unitprice> <quantity>%s</quantity> </orders> </ParentTag> ''' template2 = \ ''' <details> <productid>%s</productid> <productname>%s</productname> </details> My objective is to get an xml file...

Parse XML using LINQ to XML?

c#,xml,linq-to-xml
I try to use Linq to parse a XML in C#. this is the XML I am parsing: <Credit> <LoanApp> <LoanAppRq PaymentCall="True" Personal="True" Type="Finance"> <Applicant> <Personal> <Individuals> <Individual Type="Applicant"> <GivenName> <FirstName>test</FirstName> <LastName>tester</LastName> </GivenName> <ContactInfo> <Address Type="Current"> <StreetNumber>6</StreetNumber> <StreetName>alton AVE</StreetName>...

Extracting XML data from CLOB

sql,xml,oracle
How can I extract Food ItemID and Food Item Name and Quantity from the data as mentioned below. This is in clob column in plsql. <ServiceDetails> <FoodItemDetails> <FoodItem FoodItemID="6486" FoodItemName="CARROT" Quantity="2" Comments="" ServingQuantityID="142" ServingQuantityName="SMALL GLASS" FoodItemPrice="50" ItemDishPriceID="5336" CurrencyName="INR" Currency Id="43"/> </FoodItemDetails> <BillOption> <Bill Details Total Price="22222" BillOption="cash"/> </BillOption> <Authoritativeness/>...

Parsing XML array using Jquery

javascript,jquery,xml,jquery-mobile
I have stuck up with an issue of passing XML using Jquery. I am getting empty array while traversing to jquery.Please help me how to get datas from XML array. I have mentioned my code below. XML <?xml version="1.0" encoding="UTF-8"?> <json> <json> <CustomerName>999GIZA MID INSURANCEAND SERVICES PVT LTD</CustomerName> <mobiLastReceiptDate>null</mobiLastReceiptDate> </json>...

Ninject generic type xml binding

c#,xml,generics,ninject
I need to bind generic interface with generic implementation using Ninject.Extensions.Xml. The project is .net mvc project. Is there any way to accomplish this ? The class: public class JsonProvider<T> : IJsonProvider<T> where T: new() { ... } Xml configuration (Not working): <bind service="Base.IJsonProvider, Base" to="Base.JsonProvider, Base" name ="Config"/> ...

Using LINQ to reference XML local Xelements

c#,xml,linq
All, It's easy enough to do reference the LocalName of an Element when using a foreach. However, if I'm interested in a particular element name, perhaps because each element has an array of children elements and I want a LocalName of a parental element, how do I go about it,...

Unable to construct Document object from xml string

java,xml,xpath,xml-parsing
I have xml string coming to my appliaction like follows <?xml version="1.0" encoding="UTF-8"?><loc:getLocation xmlns:loc="http://www.csapi.org/schema/parlayx/terminal_location/v2_3/local"> <loc:address>tel:+919420161525</loc:address> <loc:requestedAccuracy>500</loc:requestedAccuracy> <loc:acceptableAccuracy>500</loc:acceptableAccuracy> </loc:getLocation> I want to construct Document object from this so that using XPath, I can retrieve required data. I tried following code...

how to insert the xml data to sql server using c#?

sql,xml,stored-procedures,sql-insert
I am beginner to the C#, I need to insert my XML file to SQL table pro-grammatically XML file have five nodes called root, name, subject, sno and queries, I will listed below <root> <name> MyName </name> <subject> newsubject </subject> <queries> <sno> 1 </sno> <query> This is the query one...

Multiply arrays by arrays in JAVA

java,arrays,xml,permutation
I have for example three arrays (but I can have more) with some values like this: table_1 = [a,b,c]; //three elements table_2 = [d]; //one elements table_3 = [e,f]; //two elements and I want to get that output <test> <test_1>a</test_1> <test_2>d</test_2> <test_3>e</test_3> </test> <test> <test_1>a</test_1> <test_2>d</test_2> <test_3>f</test_3> </test> <test> <test_1>b</test_1>...

How to Get more than one Childnode innertext using C#?

c#,sql,xml,xmlnode
I am reading XML file and storing in a table, but unfortunately I am not getting all the child node innertext values, please find my xml file and csharp coding and suggest solution. XML: <?xml version="1.0" encoding="UTF-8"?> <root xmlns:ce="www.dummy.com" xmlns:mml="www.dummy.com"> <head> <title></title> </head> <body> <queries> <query><label>1</label>Please check the first hierarchy.<page>1</page></query>...

List view not returning to original state after clearing search

java,android,xml,android-activity,android-listfragment
I'm trying to get my list to show all my items again whenever I cancel a search from my search view but for some strange reason, the list gets stuck with the results only from the previous search. Does anyone know what is wrong with my code and how to...

Is complexity of scala.xml.RuleTransformer really exponential?

xml,scala,time-complexity
This is a follow-up to one of my previous posts. I tried to understand why the RuleTransformer performance is so poor. Now I believe that it is so slow because its complexity is O(2n), where n is the height of the input XML tree. Suppose I need to rename all...

Which LiftResponse class is appropriate for returning an XML based file format?

xml,http,lift
I have a Lift application which generates a Gephi file on the fly. The Gehpi native format is XML based. The current plan is that the file gets downloaded and opened in Gephi on the client, without being processed/displayed in the browser. I looked through the LiftResponse subclasses and it...

removing a parent node dependig upon child node using xslt

xml,xslt
i am looking forwar for an template that removes anode from xml depending upon the value of a chid node,basically i am having an xml like: <EventInfo> <AssignmentEvent> <CreateDateTime>2015-06-02T00:00:00+02:00</CreateDateTime> </AssignmentEvent> <EstimateEvent> <CreateDateTime>2015-06-02T07:38:28.0000000Z</CreateDateTime> <CommitDateTime>2015-06-04T14:29:38.0000000Z</CommitDateTime> <UploadDateTime>2015-06-04T14:29:39.7651796Z</UploadDateTime>...

How to store a string in xml file and use it in _Layout in MVC

c#,xml,asp.net-mvc,asp.net-mvc-4
I'm new here. I've started working my own forum system recently to use as a portfolio. Decided to let the admin of the website set his own name and description for the forum. So first thought was use .ini file to put the string there but C# does not support...

get XML tags from URL using javascript

javascript,ajax,xml
i'm trying to get some tags from the next xml file which is located here: http://open.api.ebay.com/shopping?version=581&appid=EBAYU91VTR1SQ8H917BC11O3BW8U4J&action=getResults&callname=FindItemsAdvanced&QueryKeywords=Aston+Martin+V12+Vanquish&categoryId=220 what do i need to do in order to get the "110" from the tags below: <TotalItems>110</TotalItems> using javascript?...

Giving a prepared SOAP response by Java

java,xml,web-services,soap
I have a client, I want to make the server off by changing endpoint for exceptional situations and I want to give a prepared response for the request. As there are many security issues for preparing the SOAP messages, I don't want to make a complex fully completed (fake/mock) webservice...

Create XSD based on root element

java,xml,parsing,xsd
I have a XSD as shown below , i need to extract all the root Elements in the XSD and create a separate XSD for each root element pragmatically in java, is there some framework of java library that can aid me in achieving this. <?xml version='1.0' encoding='windows-1252'?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"...

Multiple results on a Xml stack with lml (Python)

python,xml
This is what i want into an external xml file, through a for bucle add a registry with the same tag in <Data>as <Availability> and <Price> like this: <UpdateInventoryRequest> <StartDate>21/12/2015</StartDate> <RoomId>1</RoomId> <Data> <Availability>1</Availability> <Price>100</Price> <Availability>3</Availability> <Price>120</Price> </Data> </UpdateInventoryRequest> And this is my code now, everytime returns the same value in...

XSLT for-each statement not iterating proper amount of times

xml,xslt
I am having trouble with my XSLT for-each statements. When I run the XML through the XSLT, it only comes up with the first iteration of the list, and then stops. It doesn't post the values either. Here is the XML code. <?xml version="1.0" encoding="UTF-8"?> <template> <L> <Q>Hey</Q> <Q>There</Q> <Q>Thank...

XSL transformation outputting multiple times and other confusion

xml,xslt,xpath
I'm attempting to transform a section of an XML document (which is mostly HTML) with a templated piece of markup should a particular pattern be matched. I'm inexperienced with XSLT (I've only used xpath, really) and online documentation is sparse so I'm struggling with it... To the following XML document:...

Tagging values in HTML document for automated extraction

html,xml,html5
We have a series of documents that are being converted to HTML for web access. The documents are operating instructions that list actions people have to do as well as distinct requirements. We wanted to put a tag around each requirement so it can be automatically extracted using some code....

Load XML to list using LINQ [duplicate]

c#,xml,linq
This question already has an answer here: XDocument to List of object 1 answer I have following XML: <?xml version="1.0" encoding="utf-8"?> <start> <Current CurrentID="5"> <GeoLocations> <GeoLocation id="1" x="78492.61" y="-80973.03" z="-4403.297"/> <GeoLocation id="2" x="78323.57" y="-81994.98" z="-4385.707"/> <GeoLocation id="3" x="78250.57" y="-81994.98" z="-4385.707"/> </GeoLocations> <Vendors> <Vendor id = "1" x="123456" y="456789" z="0234324"/>...

Validation error in XML Schema for complexType

xml,xsd,xml-validation
Error: s4s-elt-must-match.1: The content of 'viviendas' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: complextype. Schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns="http://wwww.vivienda.io" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.vivienda.io"> <xs:element name="viviendas"> <xs:complextype> <xs:sequence maxoccurs="unbounded"> <xs:element name="vivienda" minoccurs="1">...

XML Schema 1.0 “All” with multiple same elements?

xml,schema
What I want to validate is the XML looks like below: <A></A> <B></B> <C></C> <D></D> <E></E> <E></E> A,B,C,D just have zero or one. And they don't have sequence. It could be D,C,B,A. And in the very end, there are one or more E element(s). I have tried multiple ways, but...

About sorting based on the counting of subelements

xml,xslt
i have an xml document with properties that belong to agencies: <agency name="Century 42" num="Century42" mail="[email protected]"/> <property agency="Century42" ....> ... I would like to print the info of all agencies. The agencies should be sorted by the number of properties that they own. I tried this but it does not...

PowerShell XML formatting issue

xml,powershell
I'm having trouble getting a properly formatted XML file using the following code: # Get Computer System info $CompInfo = Get-WmiObject Win32_ComputerSystem $CompName = $CompInfo.Name # Get IP Address $IPAddressTemp = Test-Connection $CompName -count 1 | select Address,Ipv4Address $IPAddress = $IPAddressTemp.IPV4Address # Begin Writing values to XML Document $filePath =...

XSL - iterate through elements and update based on the node index from another xml file

xml,xslt
I have an XML file with multiple Shape elements each with a child Material element that contains a Code attribute. I want to update the Code attribute for each Material element based on a value that is obtained from a separate XML file. The problem I have is that the...

How get value from property file to input in springConfig.xml

java,xml,spring-mvc
I want to get the property value in email.properties file to input in the springConfig.xml. but there is an error occur. here is my code below springConfig.xml <bean class="org.springframework.mail.javamail.JavaMailSenderImpl" id="mailSender"> <property name="host" value="${email.host}" /> <property name="protocol" value="${email.protocol}" /> <property name="port" value="${email.port}" /> <property name="username" value="${email.username}"/> <property name="password" value="${email.password}" />...

How to set up XPath query for HTML parsing?

python,xml,parsing,xpath,lxml
Here is some HTML code from http://chem.sis.nlm.nih.gov/chemidplus/rn/75-07-0 in Google Chrome that I want to parse the website for some project. <div id="names"> <h2>Names and Synonyms</h2> <div class="ds"><button class="toggle1Col"title="Toggle display between 1 column of wider results and multiple columns.">&#8596;</button> <h3 id="yui_3_18_1_3_1434394159641_407">Name of Substance</h3> <ul> <li id="ds2"> `` <div>Acetaldehyde</div> </li> </ul>...

type conversion performance optimizable?

c#,xml,csv,optimization,type-conversion
The following snippet converts xml data to csv data in a data processing application. element is a XElement. I'm currently trying to optimize the performance of the application and was wondering if I could somehow combine the two operations going on below: Ultimately I still want access to the string...

Adding Post data to XML String

php,xml,post
I collect data from a form like this : $title = $_POST["title"]; $fname = $_POST["first_name"]; $surname = $_POST["surname"]; I want tot build an XML String and add the above post data. I have tryed the following and none of it works. It has to use "" double quotes ! $XPost...

Ruby- get a xml node value

ruby,xml
can someone help me in extracting the node value for the element "Name". Type 1: I am able to extract the "name" value for the below xml by using the below code <Element> <Details> <ID>20367</ID> <Name>Ram</Name> <Name>Sam</Name> </Details> </Element> doc = Nokogiri::XML(response.body) values = doc.xpath('//Name').map{ |node| node.text}.join ',' puts values...

Deserializing or parse XML response in Symfony2

php,xml,symfony2,deserialization,jmsserializerbundle
I am calling a API method through cURL and I got this response: <?xml version="1.0" encoding="UTF-8"?> <jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload"> <id>75080000002s5siAAA</id> <operation>query</operation> <object>User</object> <createdById>00580000008ReolAAC</createdById> <createdDate>2015-06-23T13:03:01.000Z</createdDate> <systemModstamp>2015-06-23T13:03:01.000Z</systemModstamp> <state>Open</state>...

Convert contents of an XmlNodeList to a new XmlDocument without looping

c#,xml,xpath,xmldocument,xmlnodelist
I have Xml that I filter using XPath (a query similar to this): XmlNodeList allItems = xDoc.SelectNodes("//Person[not(PersonID = following::Person/PersonID)]"); This filters all duplicates from my original Persons Xml. I want to create a new XmlDocument instance from the XmlNodeList generated above. At the minute, the only way I can see...

Change attribute value of an XML tag in Qt

c++,xml,qt
I'm trying to change the language attribute of a .ts file in Qt using Qt itself. Here is the sample XML format. <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE TS> <TS language="es_ES" version="2.1"> ... </TS> I have tried different ways, but no luck. Here are the methods I used. FileIOError FileIO::changeLanguageOfTsFile( QString tsFileName,...

How to convert XML into PDF/A using java api?

xml,pdfa
I am trying with JAX-B and iText to convert the XML into PDF, Can anyone suggest me which API is best suitable for this requirement.

XMLPullParser black diamond question marks with certain characters

android,xml,character-encoding,xmlpullparser,questionmark
I'm making an android app, that needs to fetch and parse XML. The class for that was made following the instructions from here http://www.tutorialspoint.com/android/android_rss_reader.htm and the fetcher method looks like this: public void fetchXML() { Thread thread = new Thread(new Runnable() { @Override public void run() { try { URL...

Fixed element in android?

android,xml,android-fragments
I am using a FAB(Floating action button) and a ViewPager that has a list inside a fragment. The ViewPager stops due to the FAB block and each are blocks the ViewPager being on top of the FAB activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:fitsSystemWindows="true">...

Serialize/Deserialize class containing byte array property into XML

c#,.net,xml,serialization,.net-4.0
My data class that will be serialized into XML look like this: [XmlType(TypeName = "SPCFileInfo")] [Serializable] public class SPCFileInfoProtocol { [XmlElement("CompanyCode")] public string CompanyCode { get; set; } [XmlElement("FileName")] public string FileName { get; set; } [XmlElement("FileVer")] public int FileVer { get; set; } [XmlElement("FileSize")] public long FileSize { get;...

Remove all nodes in a specified namespace from XML

c#,xml,linq-to-xml
I have an XML document that contains some content in a namespace. Here is an example: <?xml version="1.0" encoding="UTF-8"?> <root xmlns:test="urn:my-test-urn"> <Item name="Item one"> <test:AlternativeName>Another name</test:AlternativeName> <Price test:Currency="GBP">124.00</Price> </Item> </root> I want to remove all of the content that is within the test namespace - not just remove the namespace...

XQuery XML insert

xml,xslt,xquery,transformation,osb
I have XML based target data: <myTargetData> <myMap> <pairs> <key>KEY_1</key> <value> <myMap> <pairs> <key>INNER_KEY_1</key> <value/> </pairs> <pairs> <key>INNER_KEY_2</key> <value/> </pairs> <pairs> <key>INNER_KEY_3</key> <value> <myMap> <pairs> <key>INNER_INNER_KEY_1</key> <value/> </pairs> <pairs> <key>INNER_INNER_KEY_2</key> <value/>...

how to make xml values comma seperated using XPath, XQuery in Sql Server

sql-server,xml,xpath,xquery
I have an xml column with sample values as <error> <errorno>BL04002055</errorno> <description>Smart Rule PROJECT_COUNTRYCODE_VAL Violated</description> <description2>Country Code is required</description2> <correction /> </error> <error> <errorno>BL01001973</errorno> <description /> <description2>Error While Saving the Project info</description2> <correction /> </error> <error> <errorno>Unable to Create Custom...

Springboot REST application should accept and produce both XML and JSON

java,xml,rest,jackson,spring-boot
I am working on Springboot REST API. My application should consume and produce both XML and JSON. I came across the Jackson json Xml dependency. <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-xml</artifactId> <version>2.5.4</version> </dependency> I added this in my pom.xml. Now I am able to accept xml input but the values are null when mapped...

C# Validate DataSet filled with DGV data as XML

c#,xml,validation,datagridview,xsd
I want to make a "Save as" button which will validate data from dataGridView with .xsd XML schema before saving it as an XML file. The idea was to save DataTable filled with DGV data as an XML, validate it with .xsd and delete it if the file is valid...

How to calculate max string-length of a node-set?

xml,xslt,xslt-1.0,libxslt
I am trying to use XSLT to turn an XML document into plain text tables for human consumption. I am using xsltproc, which only implements XSLT 1.0 (so max is from EXSLT actually). I tried the below, but the commented-out definition fails because string-length returns only a single value (the...

How to extract efficientely content from an xml with python?

python,xml,python-2.7,pandas,lxml
I have the following xml: <?xml version="1.0" encoding="UTF-8" standalone="no"?><author id="user23"> <document><![CDATA["@username: That boner came at the wrong time ???? http://t.co/5X34233gDyCaCjR" HELP I'M DYING ]]></document> <document><![CDATA[Ugh ]]></document> <document><![CDATA[YES !!!! WE GO FOR IT. http://t.co/fiI23324E83b0Rt ]]></document> <document><![CDATA[@username Shout out to me???? ]]></document> </author> What is the most efficient...

C# XML: System.InvalidOperationException

c#,xml
I have been learning C#'s XML with a project however I keep getting the InvalidOperationException. I have put the code below XmlTextWriter writer = new XmlTextWriter(path, System.Text.Encoding.UTF8); writer.WriteStartDocument(true); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.WriteStartElement("User Info"); writer.WriteStartElement("Name"); writer.WriteString(userName); writer.WriteEndElement(); writer.WriteStartElement("Tutor Name"); writer.WriteString(tutorName); writer.WriteEndElement();...

Split XML into multiple files using xslt on string length

xml,xslt,xslt-2.0
I'm looking at trying to split an XML file into 2 separate files. They have to be split on the length of a string in a particular element. I've been attempting to use the <xsl:for-each-group> and <xsl:result-document> elements in order to do this but only get the 1st matching 'object'...

Selecting data in XSL from different sections of XML

xml,xslt
I am new to XSLT. I have an XML- <root> <fiberList> <fiber> <A>abcd</A> <B>bcde</B> <C>cdef</C> </fiber> </fiberList> <generatorList> <generator> <D>defg</D> <E>efgh</E> </generator> </root> I want to transform this XML into another XML through XSL. The resulting XML should be something like this- <parent> <child> <M>abcd</M> <N>bcde</N> <O>efgh</O> </child> </parent> But...

XSLT get all nodes with text

xml,xslt
I'm trying to loop through all nodes with text in my document from a certain location. <xsl:template name="interpret_text"> <xsl:param name="location"/> <xsl:for-each select="$location//text()"> <xsl:choose> <xsl:when test="name(.) = tag_im_looking_for"> <!-- various code stuff and closing tags --> This code is functional except you may notice my problem. When I enter the for-each...

Magento simplexml_load_string() error location

php,xml,magento
I have a really annoying problem. I was doing some alterations to Magento shop when I ran into simplexml_load_string() error, it is clear to me that this error is caused by some bad XML file, but the very important question to me is which file and where is it located?...

Adding custom style to button in styles.xml gives error

android,xml
According to this this tutorial, whenever I try to copy the code in styles.xml file, as soon as the <style name = " "> attribute changes from AppTheme to button_text it gives me a rendering error - java.NullPointerException. I am using Android Studio. styles.xml: <?xml version="1.0" encoding="utf-8" ?> <resources> <style...