Extensible Markup Language (XML) refers to the encoding of documents such that they can be read by both machines and humans. XML documents use tags to show the beginning and end of a set of data. XML is used extensively on websites to show volumes of data, and is the default for a number of office productivity suites. This topic includes discussions of XML-related technologies, such as XQuery (the XML Query language), XPath (the XML Path language), XSLT (eXtensible Stylesheet Language Transformations), XLink (the XML Linking language) and XPointer (the XML Pointer language).

Share tech news, updates, or what's on your mind.

Sign up to Post


Using SQL Server 2012.

I have an xml held by a variable called Variables.  How can i empty every node?  i.e. set it to nil or clear it.

declare @Variables xml = 
'<Variables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <UserFirstName xsi:nil="true" ></UserFirstName>
  <UserHSAIdentity xsi:nil="true" ></UserHSAIdentity>
  <UserEmailAddress2 xsi:nil="true" ></UserEmailAddress2>
  <UserAdressRad2 xsi:nil="true" ></UserAdressRad2>
  <UserAdressRad3 xsi:nil="true" ></UserAdressRad3>
  <UserPostKod xsi:nil="true" ></UserPostKod>
  <UserPostStad xsi:nil="true" ></UserPostStad>
  <UserTelefon1>12344 129877</UserTelefon1>
  <UserTelefon2 xsi:nil="true" ></UserTelefon2>
  <UserChangePasswordDateTime>Aldrig ändrat</UserChangePasswordDateTime>
  <UserLockedDateTime>2018-02-09 14:23</UserLockedDateTime>
  <UserGDPRApprovalDateTime xsi:nil="true" ></UserGDPRApprovalDateTime>

Open in new window

Announcing the Winners!
LVL 13
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Hello, I'm having a problem to extract some information that are in some XMLs and write all of them in a CSV to can train my AI. Like I have some XMLs with informations and I need to take this informations and put all of them in a CSV.

The information that I need to take in the CSV are like: ** + "filename", ymin, ymax, xmin, xmax
in javascript, with xml string "<people><firstname>John</firstname><lastname>John</lastname></people>"

how can loop them like?

foreach ()
alert(xml<firstname> = 'john')

I do not want to call one by one. I just want to loop through all the nodes.

We have an existing void to generate pdf on the fly using below. Basically, read the xml string and
using the node as field name and value.

My question is: we want to integrate it with DocSign but the data source xml is remind the same.
In DocSign, is it possible to use its template,  and read the template's fields and populate the value like below?


  public static void CreateAppDocument(string pdfTemplate, string newFile, string xmlString)
            pdfTemplate = @"C:\Users\source\repos\Surety\Appstore\file\app\"+ pdfTemplate;
            newFile = @"C:\Users\source\repos\Surety\Appstore\filedoc\" + newFile;
            PdfReader pdfReader = new PdfReader(pdfTemplate);
            PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(newFile, FileMode.Create));
            AcroFields pdfFormFields = pdfStamper.AcroFields;
            #region all fields 
            //xmlString = "<Surety><PrincipalFirstName>RICKasdfY</PrincipalFirstName><PrincipalLastName>YsdafdsU</PrincipalLastName><PrincipalMiddleName>ASDF</PrincipalMiddleName><PrincipalNameOnBond>11</PrincipalNameOnBond><PrincipalDba>SDFDS</PrincipalDba><PrincipalEntity>Sole 

Open in new window

I have a small project to pick up SAML response inside of Page_load() in c#/aspx and I am new about this.
And I just need to pick up the value under

and capture the value e.g. Pick Me Up. Do you know how to do that?

I just copy and paste the whole xml for you to review.

<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
  <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
  <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
      <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
      <ds:Reference URI="#_d73467246a0186aedf01809245da7aaa">
          <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
          <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">

Open in new window

Deploying  MS office using SCCM

following step by step Deploying  MS office using SCCM on the link above, the  Author mentioned the usage of XML file.
I am not sure if that xml file will be created by Office Customization Tool or we manually need to create it. Also what do we need to put in it as most of SCCM admins do not know about xml language.

Any clarifications will be very much appreciated.
I have a new project , where I have to upgrade an asp.net application. currently, application saves XML file in column with varchar(max). the application reads the XML file from the database, saves it to the session and data is read from the XML and displayed to the user. any changes from the user to the data is saved to the XML and eventually saved back to the database.

this workflow of saving the file to the session is not secure and also not efficient. I am planning to create tables/columns for all of the data points in the XML.

with this approach, I can just read the data points needed for a web page  being displayed without
having to load the full XML file in the session.

any thoughts/comments/suggestions for this approach or is there a better way to do this?

I'm trying to display data from an XML file with an APS.NET MVC project but running into a few issues in the code below, with the following error messages:

The type or namespace name 'CustomerExample' could not be found (are you missing a using directive or an assembly reference?) in File DisplayXMl.cshtml, the project's name was from CustomerExample to CustomerExample1, and no where in the application CustomerExample is still mentioned.

I am also receiving 3 additional errors in the CustomerController.cs file:

2. A namespace cannot directly contain members such as fields or methods.  on line " public List<CustomerModel> ReturnData()"

3. 'Server' does not contain a definition for 'MapPath'. on line " string xmldata = Server.MapPath("/XMLFile/CustomerData.xml");"

4. Cannot implicitly convert type 'int' to 'string'. on line " Contact = Convert.ToInt32(rows[2].ToString()),"

How do I fixed those errors, unfortunately can not upload the project as a zip file.

CustomerController.cs file:

using CustomerExample1.Models;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CustomerExample1.Controllers
    public class CustomerController : Controller

        public ActionResult DisplayXMl()
            var data = new List<CustomerModel>();
            data = ReturnData();
            return View(data);


Open in new window

I'm working on a script to pull various elements from our server environment.
For the sake of simplicity, I've removed a lot of what I'm retrieving from below.

Essentially, I'm extracting the appropriate data - writing that output, then pushing it through a function to compare against some thresholds to determine if it's a concern or not.
That in turns writes out a new object that is comprised of only strings (rather than the child objects produced initially).  In the end, I don't need to know what's working - but what is of a concern.  I.e - if I have 14 volumes, but 13 of them are in good shape, only report on the ones nearing capacity (and change the coloring for that field).

I've got all that working, and I end up just leaving a 'Pass' value if everything looks good.  If not, I prepend the field with Warn or Fail based on the logic I'm using.

Now I want to convert it all to a table and remove the 'Warn' and 'Fail' from the field, but I'm stuck because of my lack of knowledge at how to get at these values and manipulate the data, and have it hold.

Here's what's produced in my [xml]$html variable after running it through Convertto-html (would love to remove the colgroup, since I'm obviously not using that, but haven't found a way to do that either).

InnerText          : 
InnerXml           : <table><colgroup><col /><col /><col /><col /><col /><col /><col /><col /><col /><col 

Open in new window

I am brand new to EXCEL to XML conversion so I typed up an XML file with the multiple attribute fields I need to map to and I have an excel spreadsheet with all the columns with rows of data but when I import the XML mapping file I am only seeing the first attribute. What am I doing wrong? :(

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<import xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <node type="Document" action="Create">
            <location>dhc Home</location>
            <category name="Content Server Categories:By Global:Document Info">
                  <attribute name="Document Date">20190828</attribute>
                  <attribute name="Document Type">Contract</attribute>
                  <attribute name="Phase at Creation">Phase 2 - Design</attribute>
                  <attribute name="Primary Contact">RReid</attribute>
                  <attribute name="Subject">Commercial</attribute>
            <category name="Content Server Categories:By Document Types:Drawing">
                  <attribute name="Drawing Number">1A</attribute>
                  <attribute name="Revision Number">0-7</attribute>
            <category name="Content Server Categories:By Global:Migration">
                  <attribute name="Description"> PATH FILE IS FROM .....\BUSTER 1993-001.pdf</attribute>
                  <attribute name="Source">SOURCE system FOLDER PATH</attribute>
            <category name="Content Server Categories:By Global:Third Party">
                  <attribute name="Company">11 Taconic LLC</attribute>
                  <attribute …
Rowby Goren Makes an Impact on Screen and Online
LVL 13
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Please can someone advise why certain of the map pins from the KML do not show up properly on some viewers, but are ok on others.

My KML is available at http://www.smartinsight.co.uk/test.kml

You will see that some pins just show as standard blue markers, whereas they should be coloured and contain a number as per the <styleurl> details

<?xml version='1.0' encoding='utf-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
  <Document><Style id='230'><IconStyle><Icon><href>https://raw.githubusercontent.com/Concept211/Google-Maps-Markers/master/images/marker_green8.png</href><scale>2.0</scale></Icon></IconStyle></Style>
<Style id='231'><IconStyle><Icon><href>https://raw.githubusercontent.com/Concept211/Google-Maps-Markers/master/images/marker_green5.png</href><scale>2.0</scale></Icon></IconStyle></Style>
<Style id='235'><IconStyle><Icon><href>https://raw.githubusercontent.com/Concept211/Google-Maps-Markers/master/images/marker_green1.png</href><scale>2.0</scale></Icon></IconStyle></Style>
<Style id='238'><IconStyle><Icon><href>https://raw.githubusercontent.com/Concept211/Google-Maps-Markers/master/images/marker_green1.png</href><scale>2.0</scale></Icon></IconStyle></Style>
<Style id='239'><IconStyle><Icon><href>https://raw.githubusercontent.com/Concept211/Google-Maps-Markers/master/images/marker_green2.png</href><scale>2.0</scale></Icon></IconStyle></Style>

Open in new window

Is there any way to build SOAP XML by using C# class,In present approach we are building SOAP XML statically.Please suggest us better way to build from class.

C# Class
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
namespace Xml2CSharp
    [XmlRoot(ElementName = "customerIdentifier", Namespace = "http://cls.chase.com/loyalty/service/profile/message/v0700")]
    public class CustomerIdentifier
        [XmlElement(ElementName = "type", Namespace = "http://cls.chase.com/common/service/business/type/v0104")]
        public string Type { get; set; }
        [XmlElement(ElementName = "value", Namespace = "http://cls.chase.com/common/service/business/type/v0104")]
        public string Value { get; set; }

    [XmlRoot(ElementName = "productIdentifier", Namespace = "http://cls.chase.com/loyalty/service/profile/message/v0700")]
    public class ProductIdentifier
        [XmlElement(ElementName = "type", Namespace = "http://cls.chase.com/common/service/business/type/v0104")]
        public string Type { get; set; }
        [XmlElement(ElementName = "value", Namespace = "http://cls.chase.com/common/service/business/type/v0104")]
        public string Value { get; set; }
        [XmlElement(ElementName = "internalIndicator", Namespace = "http://cls.chase.com/loyalty/service/profile/shared/v0700")]
        public string InternalIndicator { get; set; }

    [XmlRoot(ElementName = "credentials", Namespace = 

Open in new window

Can a PLC extract information from a XML stream ?  How?
1.What code can be uses to looks for values in the below XML code example?  For example,  looks for "LaserPower" and then extract the values that follows . In the below code the value that follows is 95.  

2- Can we do that with FactoryTalk or a PLC?

<?xml version="1.0" encoding="UTF-8"?>
<DynaMark-Project title="Demo" version="0.2">
      <MachineSetup type="string" />
      <EditorType type="string" />
      <EditorVersion type="string"></EditorVersion>
   <Dynamark-Object type="CObjText">
      <CObjBaseData template-version="0.2">
         <ObjName type="string">Text</ObjName>
         <ParamDelaysName type="string">Default</ParamDelaysName>
         <Invers type="bool" value="false" />
         <Mark type="MarkEnableMode" value="true" />
         <Offset type="CPoint" value="-56.0489 16.1231" />
         <ScaleX type="float" value="2" />
         <ScaleY type="float" value="2" />
         <RadiantX type="float" value="-1.5708" />
         <RadiantY type="float" value="-1.5708" />
         <MirrorX type="bool" value="true" />
         <MirrorY type="bool" value="true" />
         <Hatching type="Hatching" value="none" />
         <LaserNr type="integer" value="0" />
         <MinVectorLength type="float" value="0" />
         <XCenterMode type="CenterMode" value="center" />
         <YCenterMode type="CenterMode" value="center" />
         <Locked type="bool" value="false" />

Open in new window

we are struggling with Start menu customization in windows 10.

we created an image of windows 10 and customized the image by uninstalling applications, unpin tiles from the start menu. once we had the desired interface we exported the start menu into an xml file. configured the xml as a startup script.

when we deploy the image, all the customizations are lost and the user gets all apps and shortcuts back.

tried a lot of things but no luck. struggling with this for two days  now. any help appreciated.
I am doing some nessus remediation.

This is the problem that the scan has identified
"The remote Windows host contains unsupported XML parsers."

It has give this solution as well as the URL below.

"Upgrade the software packages responsible for the unsupported DLL
versions or upgrade to a supported version of Windows (Vista / 2008 or
later). Alternatively, uninstall the outdated MSXML or XML Core


However,I am not sure who I would go about updating the MSXML as is recommended here.

Any suggestions?
I have got some VBA codes in an EXCEL file to find and replace some texts in XML files located in a specific directory(please see the attached files). It works well when the XML files are encoded in UTF-8.
The problem is, the files that I need to manipulate are encoded in UCS and I get  'input past end of file'  error when I try the code on them.

I appreciate if you could help me to resolve this.

Kind regards,
Hi I would like to build a google sheet that is able to scrap the gasbuddy website to find prices and record a history of prices at a certain location, for a type of gas.

I've read it is possible using import xml and using an xpath expression.

I think I understand the importxml function - seems basic.

its the xpath expression that is bedoggling me....anyone try this?  

I would like to use PowerShell PnP to provision a custom action to a specific list.  What I have done towards that end is I wrote a console application which adds a button to the list so that when I select a list item, the item tab on the ribbon has my new button and a call to JavaScript function which I add to the page with a Script Editor Web Part.  

Step two, I ran some PnP to pull the template for that list (with the button).

$listName = "SomeList";
$outputTemplateFileName = $path +  "SomeList.xml";
$template = Get-PnPProvisioningTemplate -OutputInstance -Handlers Lists
$listTemplate = $template.Lists | Where-Object { $_.Title -eq $listName }
Save-PnPProvisioningTemplate -InputInstance $template -Out $outputTemplateFileName

Open in new window

Step 2 - Edit the xml file that was saved such that it only has the CustomAction for this new button.  This is the step that is my challenge.  How do I strip out just that part and still add the button to a list?
Expert Spotlight: Joe Anderson (DatabaseMX)
LVL 13
Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

I have an XML String that is stored in a XML field in a SQL table.
I want to be able to pull specific values from the node header for each element.
For example, I want to pull requestID and statusCode from the string blow in a TSQL Query.

I typically use a method like:
                Update      Invoices
                Set            qbListID = x.c.value('TxnID[1]', 'varchar(50)'),
                        qbEditSeq = x.c.value('EditSequence[1]', 'varchar(50)'),
                        qbInvoice = x.c.value('RefNumber[1]', 'varchar(50)'),
                        Invoice_Syncd = getdate(),
                        Invoice_Amount = COALESCE(x.c.value('SubTotal[1]', 'real'),x.c.value('Subtotal[1]', 'real')),
                        Invoice_DueDate = x.c.value('DueDate[1]', 'varchar(50)')
                FROM            @YourTable t
                            CROSS APPLY xml_text.nodes('QBXML/QBXMLMsgsRs/InvoiceAddRs/InvoiceRet') x(c),
                Where            Invoices.invoice_ID = x.c.value('Other[1]', 'varchar(50)')
                                  and Invoices.sub_ID = '#xlist.subid#'

However, I do not know how to pull a value one leve above the elements.

    <InvoiceAddRs requestID="222528" statusCode="3120" statusMessage="Object &quot;800002B5-1362413180&quot; specified in the request cannot be found.  QuickBooks error message: Invalid argument.  The specified record does not exist in the …


I need to create a SOAP Envelop with C#.NET to consume a Java-based web service

I can use SoapUI for testing and it works properly.

now I need to create a C#.NET console app to consume this web service.

I was able to compute the <ds:DigestValue> but I couldn't' compute the SignatureValue.

note the "ds" prefix which is required for the Java-based web service and I don't have control over it.

I have tried tens of solutions from the internet and none works.


How to compute <ds:SignatureValue> base on the node <ds:SignedInfo>, it could be in C#, or any another library like OpenSSL

    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
        <ec:InclusiveNamespaces PrefixList="#default"
            xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" />
        <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
        <ds:Reference URI="#id-2">
                <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces PrefixList=""
                        xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" />
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />

Open in new window

Screenshot 1I have a SQL XML question:

I have a select query where I'm selecting items off a invoice, and I'm converting the result sets to XML using  FOR XML PATH('INVOICE'),  ROOT('INVOICES')

My issue is that a invoice could have 100 items on it. I would like all items to show under one invoice grouping or element. Not sure the correct terminology.  How do I do that?

Below, screenshot 1 shows what I want to change:

Incorrect XML

Below, in screenshot 2 you will see the correct XML. I'm trying to get my XML document above in screenshot 1, to look like this one:

Correct XML Format

I'm using SQL Server 2012.

I need to write some SQL code to insert data from an XML file.  I'm using the following which works well, but I expect that the nodes will get into the hundreds of thousands and I've already proven to myself that this solution is not scale-able.

Anyway here's an example of what I've done thus far:
An XML File:
<?xml version="1.0" encoding="utf-8"?>
	<Date>11/14/2009 21:40</Date>
	<Date>11/12/2009 18:42</Date>
	<Date>11/11/2009 20:00</Date>

Open in new window

And the SQL to import it:
-- Creating my table
    [ID] varchar(50) NOT NULL,
    [Date] varchar(50) NOT NULL,
    [AnotherID] varchar(50) NOT NULL

-- Importing the xml using openrowset and bulk insert:
INSERT INTO [MY_XML] ([ID], [Date], [AnotherID])
   MY_XML.MyNode.query('ID').value('.', 'VARCHAR(50)'),
   MY_XML.MyNode.query('Date').value('.', 'VARCHAR(50)'),
   MY_XML.MyNode.query('AnotherID').value('.', 'VARCHAR(50)')
      CROSS APPLY MY_XML.nodes('MyNodes/MyNode') AS MY_XML (MyNode);

Open in new window

Again, this works great but as I add nodes to the XML the import time increases exponentially.  

Any ideas how I can improve this?

Hi Experts,

Can you please help me to write the code in the vba script to read attached xml - I can handle to assign those values to fields.

xml file is in shared folder

1) Read the xml file from the folder
2) Read the attributes from the xml

Please help me ..

Thank you

When an Oracle table is created that contains an XMLTYPE column, a dependent table named with this pattern: SYS9999999_S_PATH_TABLE gets created automatically, apparently to contain the "domain index" for the XML column of the parent table.  We created a custom table like this some years ago, and used it regularly for a while.  Apparently the parent table is no longer active in our system because this particular SYS%_S_PATH_TABLE has had no new records added for some years now.  Prior to July of 2015, it did get new records added regularly.  I would like to truncate or drop this SYS%_S_PATH_TABLE now to reclaim the space it is using (since it contains over 12 million records) but when I try to do that, I get this error:
ORA-30967: operation directly on the Path Table is disallowed.

When I query USER_OBJECTS for: SYS14714159_XXGEN_S_PATH_TABLE, this is listed as a "TABLE".  But when I query USER_XML_INDEXES, this row is not returned.  A different SYS%_S_PATH_TABLE is returned.






Extensible Markup Language (XML) refers to the encoding of documents such that they can be read by both machines and humans. XML documents use tags to show the beginning and end of a set of data. XML is used extensively on websites to show volumes of data, and is the default for a number of office productivity suites. This topic includes discussions of XML-related technologies, such as XQuery (the XML Query language), XPath (the XML Path language), XSLT (eXtensible Stylesheet Language Transformations), XLink (the XML Linking language) and XPointer (the XML Pointer language).