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

I have an xml declared as:
declare @xmlIndata xml = '<root>
  <Period />
  <Filters />

Open in new window

I want to extract the subtree starting at the node <Variables>.  So some xml manipulation to extract the subtree and set it to @variables. Like:

declare @variables xml
set @variables = somehow select the subtree 'Variables' from xmlIndata;

Then @variables should be:
 ' <Variables>

Open in new window

seems pretty basic to be able to extract part of an xml but i cant find out how to do it.
Starting with Angular 5
LVL 13
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Hi Experts,

Firstly thank you for taking a look at my question.

I am trying to access the details of xml where the attribute = Yes.

I am trying this but it is not quite correct:

$bestmatchIndAddress = $xml->soapBody->Response->BestMatch->IndividualDetail->ContactDetails->AddressDetails['Current=Yes'];

many thanks for your help!!
Hi Experts!

Firstly thank you for taking a look at my question.  I am having a shocking morning and can't for the life of me work out how to get the details out of the XML data.

given this XML:

  object(SimpleXMLElement)#2 (1) {
    object(SimpleXMLElement)#3 (5) {
      array(2) {
        string(3) "1.0"
        string(1) "T"

How do I access the Version and Environment data?

This is what I am trying -

        $xml = new SimpleXMLElement($response);
      $consumer = $xml->xpath('//Response/Version');
      echo "<br><Br>Consumer:".$consumer;

I have worked with this before but am having a brain block this morning.

This is the current response.

Notice: Array to string conversion in C:\xampp\htdocs\illion\illion v2.php on line 55

many thanks for you help!!!
Hi Experts,

Firstly thank you for taking a look at my question!

Using PHP i need to access the xml body inside a soap packet.

the soap response looks like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <Response   Version="1.0" Environment="T" xmlns="http://www.dnb.com.au/Schema/CCB/1.0">
            <ConsumerHeader SegId="ERHD01" InternalReference="M20190912095903-023-000238" EnquiryType="1" UniqueCustomerReference="Test" ConsumerId="2190130" Country="AU" ProductCode="AMD3" NewFileCreated="0" IsMinor="0" HasSummary="1" HasJudgment="1" HasBankruptcy="1" HasSummons="1" HasOtherPublicRecord="0" HasDirector="0" HasFileNote="0" HasDefault="1" HasEnquiry="1" HasError="0" HasWarning="0">
                <EnquiryDate Year="2019" Month="9" Day="12" />
            <BestMatch MatchScore="768">
                <IndividualDetail SegId="ERID01">
                    <DateFirstRecorded Year="2003" Month="6" Day="10" />
                    <Person Sex="U">

Open in new window

I have a XML file that is imported into a field in our SQL2016 DB. The column is type XML.
An example of two records is:

<PatientData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

We are able to either get the Header info to return, the Trailer info to return or the Patient Data to return.  What are we doing wrong? We don't have a lot of experience with XML.
The examples online we are finding aren't helping.

Any assistance is appreciated.
Currently this is what we have:



EXEC sp_xml_preparedocument @hDoc OUTPUT, @XML

HI this is a continuation of thread from before
old thread

the conditions for this project has changed a little rendering the script that Michelangelo had provided no longer useful for my cause although it worked for the previous purpose

heres what changed:
the files in questions are XML format (but are not named .xml they are .901 files)
i need to remove a whole node from the *.xml files ,  including the tag

 <errsql yadadayda > 
random sql error the statement has terminated

this whole line need to be removed form the file

here is a snippet of the xml file:

<chgsql ts="07:01:58.971" op="O" jb="ADD" tb="CLL_TAB" sc="BATCH"> <fld fd="F1000" af="PAL"/>
<fld fd="F1148" af="43000135163"/>
<idx fd="F1577" af="5167599565"/>
<idx fd="F1578" af="LINK"/>
<fld fd="F1001" af="1"/>
<fld fd="F902" af="00003814"/>
<errsql ts="07:01:58.986" op="O" lv="50" ob="">
<sql>INSERT INTO CLL_TAB [F1000,F1148,F1577,F1578,F1001,F902] VALUES [:F1000,:F1148,:F1577,:F1578,:F1001,:F902] </sql>
<chgsql ts="07:01:58.986" op="O" jb="ADD" tb="CLL_TAB" sc="BATCH">
<fld fd="F1000" af="PAL"/>
<fld fd="F1148" af="43000135164"/>
<idx fd="F1577" af="5166282554"/>
<idx fd="F1578" af="LINK"/>
<fld fd="F1001" af="1"/>
<fld fd="F902" af="00003814"/>
I have to update an XML column across several hundred thousand records in SQL Server 2014
I am using a set-based approach as follows:

;WITH XMLNAMESPACES(DEFAULT 'http://www.my-company.co.uk/mcshema1/1.0')
      [Xml].modify ('replace value of (/MC/Family/Parents/Parent[@id={ sql:column("_pc.ParentId") }]/Children/Child[@id={ sql:column("_pc.ChildId") }]/Type)[1]/text()[1] with "Special Child"')
FROM [MC].[Family] C
      FROM #FamilyParent __p
      WHERE __p.[FamilyId] = C.[Id]

but keep getting the error:

Msg 2209, Level 16, State 1, Line 334
XQuery [MC.Family.Xml.modify()]: Syntax error near '{'

I'm new to xml.  May I know whether there exist any xml generator in the market?  No matter it need to pay or it is free of charge.

That is, if I provide the generator all those schema for the xml together with the data that need to be contained in the xml, the generator will generate the appropriate xml out.   Do such xml generator exist in the market?

Kindly please help.

I am trying to fill a combo Box with a list of items from a SQLite DB.
have been using/following with this https://docs.microsoft.com/en-us/windows/uwp/data-access/sqlite-databases#choose-an-abstraction-layer

SO in my
DataAcsess.cs Class i have
 public static List<String> ProductList()

            List<String> entries = new List<string>();

            using (SqliteConnection db =
                new SqliteConnection("Filename=DataStorage.db"))

                SqliteCommand selectCommand = new SqliteCommand
                    ("SELECT DOTProductname from QPL", db);

                SqliteDataReader reader = selectCommand.ExecuteReader();

                while (reader.Read())

            return entries;

Open in new window

(which I am not sure what it is doing)

then i have a

I have my XAML:
                    <ComboBox  x:Name="PName" HorizontalContentAlignment="Center" MinWidth="140" ItemsSource="{Binding}">


Open in new window

(not sure how i get the item source to work)

and finally my

XAML.CS code:
  private void ProductList(object sender, RoutedEventArgs e)
          ComboBox.ItemsSource = DataAccess.ProductList();

Open in new window

Which is throwing some errors because i am not understanding what is required.

How is the standard method to get the query convert it to a item
and then put a foreach item loop to add to my combo box or similar?
appreciate your help in advance.
I re-organized my UWP app. I created a set of folders in the solution explorer and moved the XAML files around accordingly.
I go to recreate my menu items and i run into a trouble where it doesn't recognize some of the new folders and some of the new files.
Is there a way to clean out the old references to make way for a new one? see pictures for details
Become a Certified Penetration Testing Engineer
LVL 13
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Hi EE,

This question is more of a query looking for approaches to resolve the following issue:

The user has an SSRS 2016 report and filters the datasets efficiently with filters they have been given.

However, the user wants to save specific rows within the report to key the data into another system e.g Desktop application. Exporting initial the result set data to XML result is a simple task. My question is can you have a button on the SSRS which launches a subform that asks what rows /columns specifically do you want to save from the resultset in XML format.  Completing the necessary criteria on the subform, SSRS exports the data to the user via a download.  

Is this possible in SSRS if so are there examples out there?

Any links or tips, advice are welcome.

Thank you.
THis is a duplicate question that i asked on a reddit subforum.
but without much response.

Iv been looking for weeks to find a comparable guide on using a UWP app with SQLite. All the guides i find are either out of date or using nugget packages that no longer exist. or provide super complex methods.

Im using VS 2019 Community

with this: https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Sqlite/

Trying to connect to a local .DB file

Maybe i am just not googling the correct words?

Does anyone know of a good resource that demonstrates how to connect to a local .DB file submit entry's and retrieve entry's?
I've been following this guide: https://blogs.msdn.microsoft.com/appconsult/2018/05/06/using-the-navigationview-in-your-uwp-applications/

I have my Menu items together and they act great!
However when I open the app I am having trouble setting the default view I have made a homepage when the app opens I would like the homepage to display. When using the code line in the guide it throws an exception. Screenshot:Screenshot--57-.pngHere is the code in the guide:
       if (item is NavigationViewItem && item.Tag.ToString() == "Home_Page")
                nvTopLevelNav.SelectedItem = item;

Open in new window

hopefully its something simple i am doing wrong. my homepage location is Views.HomePage

Screenshot of landing page.
Full code (abit messy i know):

    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <NavigationView x:Name="nvTopLevelNav"

Open in new window


I have an XML file on Oracle EBS Server. I need to read the XML file and get the data into Oracle Tables

I'm now having a new task which is completely new to me.  My boss asked me to grab data from an xml file which send to us on a daily basis.  I'm completely new to xml.  I find web scraping tools on the internet seems relevant to the task that I need to handle.  I also find lxml y using Python may help to solve my case.

May I know whether any short and concise (not as detail as encyclopedia) notes and materials which come with sample Python codes (at least a sample code skeleton) which demonstrate how to code scraping xml data by using lxml library under Python?

Or, if some other libraries which can do the job better than lxml under Python, that will also be welcome.  But, currently, due to license issue, I can only use Python as the programming language or Excel VBA.

Kindly please help.

Hello All,

A project has come up to on demand scan a uploaded document for viruses in our site.
Some info on our site:
C#, MVC system with razor templates and xml configurations for custom UI.
AWS hosted web server and db.
Currently the users can attach documents to various items in our system.  Those documents are stored as varbinary in the db tables.

It was suggested to me to look into Clamav.net, but I'm wondering what the best solution (tool) other than Clamav, would be for scanning of a file that goes directly into a db table and not a folder structure on the server?  If it is necessary to save the file in a folder structure in order to do the scanning then we can change the system to do that.

Thank you for your time and suggestions.

Hi EE,

I have the following query to try find missing indexes via the query store:

WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan')
SELECT qsqt.query_sql_text,
'NVARCHAR(256)') AS TableName,
'NVARCHAR(256)') AS SchemaName,
'DECIMAL(6,4)') AS ProjectedImpact,
'NVARCHAR(256)') AS ColumnGroupUsage,
'NVARCHAR(256)') AS ColumnName
FROM sys.query_store_query AS qsq
JOIN sys.query_store_query_text AS qsqt
ON qsqt.query_text_id = qsq.query_text_id
JOIN (   SELECT query_id,
CAST(query_plan AS XML) AS QueryPlan,
FROM sys.query_store_plan) AS qsp
ON qsp.query_id = qsq.query_id
JOIN (   SELECT qsrs.plan_id,
SUM(qsrs.count_executions) AS NumExecutions,
MIN(qsrs.min_duration) AS MinDuration,
MAX(qsrs.max_duration) AS MaxDuration,
AVG(qsrs.avg_duration) AS AvgDuration,
AVG(qsrs.avg_logical_io_reads) AS AvgReads,
AVG(qsrs.avg_logical_io_writes) AS AvgWrites
FROM sys.query_store_runtime_stats AS qsrs
GROUP BY qsrs.plan_id) AS rts
ON rts.plan_id = qsp.plan_id
CROSS APPLY qsp.QueryPlan.nodes('//MissingIndexes/MissingIndexGroup/MissingIndex/ColumnGroup') AS t1(ColumnGroup)

Open in new window

I have a package that loads 300 tables from DB2 to SQL Server.  We added a column to all the DB2 tables to keep track of changes named DW_LASTTIME.  
My question is, each table has a data flow task with the source table having a variable like this to pull the data.

"SELECT * FROM ABC WHERE LASTTIME >= " +  @[User::strAdjLastRunTime] +" WITH ur"

Open in new window

So I need to update all 300 to make it say

"SELECT * FROM ABC WHERE DW_LASTTIME >= " +  @[User::strAdjLastRunTime] +" WITH ur"

Open in new window

Is there any way to do this without having to manually open and update each dataflow?  Like in a text editor or something?  I know SSIS packages are just XML files but I was told if you mess with the actually file, it can corrupt it.


Can someone tell me how to use xml explicit to output this query in format below please?
select cast(C.InitialCardID as bigint) as HouseholdCard, '1' as ProgramType, '100' as adjustment from WM_CustomerSurvey a
                        JOIN  customers b on a.CARD_NUMBER = cast(b.initialcardid as bigint) and InitialCardTypeID = 0
                        INNER JOIN CUSTOMERS C ON B.HHPK = C.CustomerPK
                        where a.SURVEY_TYPE = 'Online' and a.COUPON_AWARDED = 'N'

Open in new window

Results from query looks like this.
HouseholdCard      ProgramType      adjustment
40203346685      1                              100
40201842120      1                              100
40201045770      1                              100
40990430836      1                              100
40200895929      1                              100
40201498594      1                              100

output needs to look like this
<PointsAdjust programid='1'>
Learn SQL Server Core 2016
LVL 13
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

How to prevent xml external entity (xxe)  through C#

StringReader a= new StringReader(b);
a= new XmlTextReader(a);
reader.XmlResolver = null
 <<<<<<Security tool is reporting here that possible of XXE mitigation>>>>>>>>>>>>>>>>
i applied
StringReader a= new StringReader(b);
a= new XmlTextReader(a);
a.XmlResolver = null;
a.DtdProcessing = DtdProcessing.Prohibit;
bool b = a.Read();

am not getting any value in a.
Any idea what may cause this error in java xml transformer

 [OPERATION FAILED] Fatal error occurred during XSLT transformation: javax.xml.transform.TransformerException: org.apache.xpath.domapi.XPathStylesheetDOM3Exception: Prefix must resolve to a namespace

I have very limited java knowledge (too long ago to mention) so just looking for general possibilities..
I need to generate an XML document based on the result of a database query (ADOQuery).
Is it appropriate to use a TXMLDocument component and if so how would I do this ?
I am writing a VCL application for windows using Embarcadero C++ builder XE 10.1 Berlin
Hi Experts,

I have problems with one new trust.
I created the trust with an xml file.
But when I test the trust I always get the following error, see the next message.

But when I test the metadat-link in IE I can download the file -> default-SP from the other site.

What is wrong here ?
Hi Everyone!  I got tired of endlessly searching google so I thought I'd sign up and ask this here.  I'm by no means an expert, but I'm trying to find some help adding code to my code to get these google map markers to update every 1-5 seconds, without any flashing and without a page refresh.

This code is fairly complete I think but any advise is always welcome to make it better.

<!DOCTYPE html >
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>MADAR with Google Maps</title>
      /* Always set the map height explicitly to define the size of the div
       * element that contains the map. */
      #map {
        height: 100%;
      /* Optional: Makes the sample page fill the window. */
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;

    <div id="map"></div>

      var customLabel = {
        status: {
          label: ''
        alert: {
          label: 'A'

        function initMap() {
        var map = new google.maps.Map(document.getElementById('map'), {
          center: new google.maps.LatLng(37.6458, -97.4543),
          zoom: 5,
          styles: [
            {elementType: 'geometry', stylers: [{color: '#242f3e'}]},
            {elementType: 'labels.text.stroke', stylers: 

Open in new window

I'm using the below code as an example in Laravel 5.0 to retrieve a vehicle's history.
This works, but it seems like I'm not really utilizing laravel at all and doing it using a clunky curl setup.
Laravel 5 has a SoapClient I can include, but no clue how I'd utilize based on below.

the company I'm retrieving data from has a number of operations and a few ways to get the data ie: xml, json and soap1.2 (which is what I'm referencing).

example below is: RepairOrderContactVehicleGet

Do you know of a better/simpler way I can utilize this API in Laravel 5?

I like the idea of the json one, but no idea how I'd use it. Or a better way of the soap approach.

		$username	= "myuser";
		$password	= "mypass";
		$pbs 		= 7111;
	$request = '
	<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
	<RepairOrderContactVehicleGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PBS.PartnerHub.ServiceModel">

$requestURL ="https://partnerhub.dealers.com/soap12";
	$ch = curl_init();
	$header[] = "Content-type: 

Open in new window







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).