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 a XML file which looks like this:
    <?foo bar1?>

    <?foo bar2?>


Open in new window

I want the output to be something like this:
foobar1 stuff

foobar2 stuff

Open in new window

My XSLT code looks something like this:
<xsl:template match="block">
  <xsl:apply-templates select="* | processing-instruction('foo') "/>

<xsl:template match="processing-instruction('foo')">
somehow process everything that follows, up to next "foo" processing-instruction, then output "foobar1 stuff"

Open in new window

My problem is how to process everything following the "foo" processing-instruction, up to the next "foo" processing-instruction, and then output "foobar1 stuff".

Is this even possible?
Upgrade your Question Security!
LVL 12
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Can someone please assist with re-writing a xml file as working with xml files is not one of my strong points.

I am using the OSDFrontEnd from scconfigmgr.com and as part of the OSDFront end that gets put into the the winpe boot disk.  It is basically a friendly front end of the sccm task sequence. Within the config file for the OSDFront end,  there is a option that allows you to set mandatory applications.  The problem is when you configure these settings and inject it into the winpee bootdisk it effectively gets locked and cannot be modified without re-creating or reconfiguring the boot disk itself. I wanted to find a way to export this section to a external xml file.  That way the main config in regards to where to look for the mandatory apps gets locked within the boot disk however the actual settings for mandatory apps can be stored on a web server and modified on the fly if needed.  

 The section of the config file relating to mandatoryapps is as below.

      <setting name="AppsMandatory" serializeAs="Xml">
                    <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        <string>Adobe Acrobat Reader 2017 DC</string>
                        <string>Java 8 Update 144 (32-Bit)</string>
                        <string>Java 8 Update 144 (64-Bit)</string>
How to read Child tags under parent tag with name space in C#?
<ns:tag1></ns tag1>

How to read child 1 tag?
I am able to till ns:tag2 but unable to read any further tag.
var child = parentElement.Descendants(ns + "tags").First();
This provides list of child tags, but unable to further read it.
Tried a few things like:
and child.Element("child1") (with all possible sub functions)
Even tried to reload the xml from tag2 in XElement again but that threw invalid xml exception.
but all are throwing null pointer exceptions.
There are lot written about by hiding Ribbon. Still, it seems not be too easy to hide the ribbon. Previously I used the "menu bar" and a application menu bar for the .accde (.mde) application. It worked fine. For to summaries the findings:

* use DoCmd.ShowToolbar "Ribbon", acToolbarNo
* no add-ins
* use dynamic ribbons to replace right-click
* DoCmd.ShowToolbar is not enough use DoCmd.NavigateTo "acNavigationCategoryObjectType" and  DoCmd.RunCommand acCmdWindowHide
* Search for anything which might do something with the ribbon - but what?
* move everything to a new db - sometimes access mix things up. I know, It is not so long ago I did that.
* ...

I use in Form_open event
         If Right(SetDB.Name, 6) = ".accdb" Then DoCmd.ShowToolbar "Ribbon", acToolbarYes Else DoCmd.ShowToolbar "Ribbon", acToolbarNo ' I want the ribbon while developing

Since, the menu bar is still around I disable that one as well - commndbars("Menu bar").enabled=false

I still use commandbars for right-click.

Anyway, Still the File and Home tabs are around, The File contains Privacy Options which means that they change important properties.

There is a lot of XML - code around for this. I have so far not done very much with XML, there is that code and how can I edit it?

What to do?

Thanks advanced


Using  Orgacle BI Publisher plugin, I am developing an xml report.  I want to print the footer once.  I would like a report footer as apposed to the page footer. Attached is what the utility looks like in word - this gives you an idea .

For those not familiar with this utility,  I can use code like :
<?xdofx:if fld_NC_SELCRIT1 = 'I' then 'International' else if fld_NC_SELCRIT1 = 'E' then 'Domestic’ else ‘All' end if?>

Thanks in advance,
Paras as heading sections as main and sub levels

My input xml :

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE topic
      PUBLIC "urn:pubid:doctypes:dita:topic" "topic.dtd">
    <topic id="topic_1" xml:lang="en-US" outputclass="Sec-Chapter">
        <p outputclass="Title">Head Mapp</p>
        <p outputclass="A-Head">A-Head</p>
        <p>Some paragraph text</p>
        <p outputclass="B-Head">B-Head</p>
        <p>Some more paragraph text</p>
        <p outputclass="C-Head">C-Head</p>
        <p>Yet more paragraph text</p>
        <p outputclass="D-Head">D-Head</p>
        <p>Some creative paragraph text</p>
        <p outputclass="E-Head">E-Head</p>
        <p>Now, boing paragraph text</p>
        <p outputclass="F-Head">F-Head</p>
        <p>Finally, end</p>

Open in new window

XSL template I have used for the heading level creation in DITA OT Epub plugin:

    <xsl:template match="*[contains(@class, ' topic/p ')]" name="topic.p">
    	<!-- To ensure XHTML validity, need to determine whether the DITA kids are 
    		block elements. If so, use div_class="p" instead of p -->
    	<xsl:variable name="topicatt">
    		<xsl:value-of select="@outputclass" />
    		<xsl:when test="$topicatt = 'A-Head'">
    			<h2><xsl:apply-templates /></h2>
    		<xsl:when test="$topicatt = 'B-Head'">
    			<h3><xsl:apply-templates /></h3>
    		<xsl:when test="$topicatt = 'C-Head'">
    			<h4><xsl:apply-templates /></h4>
    		<xsl:when test="$topicatt = 'D-Head'">
    			<h5><xsl:apply-templates /></h5>
    		<xsl:when test="$topicatt = 'E-Head'">
    			<h6><xsl:apply-templates /></h6>
    		<xsl:when test="$topicatt = 'F-Head'">
    			<h6><xsl:apply-templates /></h6>
    				<xsl:call-template name="commonattributes" />
    				<xsl:call-template name="setid" />
    				<xsl:apply-templates />
    	<xsl:value-of select="$newline" />

Open in new window

I am getting xhtml output using above template as:

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en-us" lang="en">
    	<body class="Section" id="topic_1">
    			<p class="TitleTtl">Heading2</p>
    			<p class="p">Some paragraph text</p>
    			<p class="p">Some more paragraph text</p>
    			<p class="p">Yet more paragraph text</p>
    			<p class="p">Some creative paragraph text</p>
    			<p class="p">Now, boing paragraph text</p>
    			<p class="p">Finally, end</p>

Open in new window

but I need output as `A-head` as `h2` main level section, `B-Head` as `h3` sub level section for `h2`, `C-Head` as `h4` sub level section for `h3`, `D-Head` as `h5` sub level section for `h4`, `E-Head` as `h6` sub level section for `h5`, `F-Head` as `h6` same level section as `h6` as shown below:

Open in new window

I have used the Dita OT 1.8.5 for epub conversion: but i need the number sequence format 01, 02, 03 .. prefix for the xhtml files names in the epub output.

I have changed the code in html-generation-utils.xsl function as below for the number sequence for file names:


 <xsl:function name="htmlutil:constructHtmlResultTopicFilename" as="xs:string">
        <xsl:param name="topic" as="document-node()"/>
        <xsl:variable name="topicFilename"
          select="concat(htmlutil:getResultTopicBaseName($topic), $OUTEXT)"
        <xsl:for-each select="$topic">
    <xsl:variable name="number"><xsl:value-of select="format-number(position(),'00')"/></xsl:variable>
    <xsl:sequence select="concat($number, $topicFilename)"/>

Open in new window

I am getting the output of the file names for all prefix as '01' only.

But i need prefix as 01, 02, 03, ...

Please suggest.

Thanks in Advance
I have  C# class from an XSD that includes several decimal fields that are in the output XML structure.  When I assign a decimal numeric value to them, all works fine.  The issue is that when the XML serializer class outputs the values, it puts 4 decimal places and I only want 2 as anything more than 2 is considered an invalid value by the program importing this XML file.

Sample below of the output XML file.  In all cases of <TotalTaxDol>, <CreditCardAmount>, <UnitPrice>, <TaxDols>, and <PriceExtension>, the output field should only have 2 decimal places, not 4.

TicketData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
i have a problem in xml parocessing in java using dom,it is my sample xml file

    <title type="main">Magnetic bead assisted labeling of antibodies at nanogram scale<link xml:id="pmic201300283-note-0001"/></title>

    <title type="tocForm">Magnetic bead assisted labeling of antibodies at nanogram scale</title>

    <title type="shortAuthors">M. Dezfouli et al.</title>


Open in new window

in this file if tocform from article tag then u Read xml file and match the content from main :if tocForm then match else ignore i am try this code
 NodeList nl = doc.getElementsByTagName("creators");
        for(int i=0;i<nl.getLength();i++)
            Node node=nl.item(i);
            NodeList nl1=node.getChildNodes();
            for(int j=0;j<nl1.getLength();j++)
                Node node1=nl1.item(j);
                Element e=(Element)node1;
                String s=e.getTextContent();
                 al.add(s);//Read content from main section
             String s=e.getTextContent();
             al1.add(s);//read content from TocFrom section
            {//do  something

Open in new window

c# how to compare two XML files to find the difference and need to traverse each and every node and detects mismatch values
Cloud Class® Course: Microsoft Azure 2017
LVL 12
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

I have an MS Access 2016 application and need to create an XML file to send to a supplier. They have given me an XSD file.
The data relates to order delivery. I hold the main delivery information in one table (Driver, Vehicle etc) and the orders that are in that vehicle in another table. They are linked by a unique delivery number.
What is the best way for me to achieve this.
I think this is quite a big question.... So any pointers gratefully received.
I'am trying to find a means to retrieve viz from a METAR weather product.

I did read an earlier question by iceman23 and answered by aikimark. It was among others regarding XML files. From what I read the XML file has a notation for viz in de code.

I want to be able to retrieve the METAR from for example LHBP and determine whether the viz is below 4200mtr. The viz group in a METAR is a tricky one since the group can be overwritten by CAVOK. This is by no means a figure but a word. Alse there is apossibily the have a vizibilty in a certain wind direction for example 5200SE.

There is a text weather possiblity in the ADDS server from NOAA. Would it be possible to automate the extraction of the viz data to EXCEL?
I want to use macros enabled excel in Samsung tablet for a xML report.
Does the device support it?
How can I logon to Huawei B525s-23a with curl ?
How to Read a node value from xml file in arduino IDE
I am exploring xml and am trying to write nested XML elements like this in Windows Powershell:






I am completely new to writing XML as well as using powershell, so if you can keep the training wheels on with your explanation/example, I would greatly appreciate it.

How to consolidate please all repport mbsa to one report

found this link to convert to xml and xls files but not my needs


I'm not expert for Scripting



Appréciate your helps :)
Thank you all in advance for your help!

I need some help enabling the following script with loop capabilities.

In other words, the script should cycle through the list of recipients sending an  email to each.

Thanks again!

Declare @email NVARchar(4000)
Declare @count NVARCHAR(MAX)
Declare @lastname VARCHAR(MAX)

Set @count =
(Select count(email)
FROM  vw_Porivder_GenbaWalk_Activity_PM_SS_6_18_18
Where Created > ' 2018-4-1'
and email = 'ana@aol.com')

Set @lastname =
Select distinct (lastname) from vw_Porivder_GenbaWalk_Activity_PM_SS_6_18_18
Where Created > ' 2018-4-1'
and email = 'ana@aol.com'

SET @xml = CAST(( SELECT email AS 'td','', convert (varchar, Created, 101) as 'td','', LOC AS 'td'
Where Created > '2018-4-1'
and email = 'ana@aol.com'
order by created desc


SET @body ='<html><body><H3>'+ 'Dr.' + @lastname + ','
' Currently ' + @count + ' genba walks have been registered for you this quarter.'
' '+ 'Please let us know if you have any questions regarding this count.'

+ ' '
+ 'Thank you!'

<table border = 1>
<th> email </th> <th> Created </th> <th> Location </th></tr>'    

SET @body = @body + @xml +'</table></body></html>'

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'ACE DB Admin', -- replace …
I need to know if this is possible with an Xpath expression or whether I need a new solution.

I need to select the correct G02 group with the E2ADRM4_PARTNER_Q="OTP and E2ADRE4_EXTEND_Q="900" but it's not a parent-child relationship between E2ADRM4 and E2ADRE4.

I though I could select the correct G02 group with predicates testing both E2ADRM4 and E2ADRE4 and then select the correct E2ADRE4 based on the E2ADRE4_EXTEND_Q alone.

<xsl:value-of select="//G01/G02 [E2ADRM4/E2ADRM4_PARTMER_Q='SP'][E2ADRE4/E2ADRE4_EXTEND_D='900']/E2ADRE4[E2ADRE4_EXTEND_Q=900]/E2ADRE4_EXTEND_D"/>

My context node at the time is G16.  Is this impossible with Xpath,  is my approach wrong or is my syntax just wrong?

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Based on format description: desadv_sr3_shp05 --><ACTIS>
            <E2ADRM4_NAME1>Schaeffler Group USA Inc.</E2ADRM4_NAME1>
            <E2ADRM4_STREET1>Highway 1 S</E2ADRM4_STREET1>
Introducing Cloud Class® training courses
LVL 12
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

I'm using Lucee / ColdFusion in connection with a Twilio app.  a CFC dynamically generates the code  for Twilio and returns it as XML.

The code worked fine on a ColdFusion server.  When we moved it to Lucee, it stopped working.

I dumped what was being pushed back to Twilio and it was adding spaces before the XML.

I changed the CFFunction to Output="FALSE" and I'm doing a trim(result) around result (the variable holding the XML code).

I'm still not getting it to work, when I place a call, Twilio basically "reads" (synthetic voice) all of the text inside the XML tags instead of executing them.

The code still works on the CF server, just not no Lucee.

Any thoughts?  Any big Lucee / CF differences that would cause this?

Thank you!!!!
1205Rucker.xmlI'm having trouble parsing xml data using PHP.  I'll attach my XML file, and I'm trying to create a variable for each <LINE type="VALLEY" /> attribute in the file.  Any help would be appreciated!
Good afternoon,

I have a weekly XML file that I need to load into a SQL database table.  

I do not need all the content, so I am using OPENXML to navigate to the my element, which in the first example below is 'preliminary/ordered_list/list_item/paragraph' and which returns data.

However, if I add the next element, i.e. 'preliminary/ordered_list/list_item/paragraph/TABLE', no data is returned.

Please see below the SQL script I am using to test an extract from this file, with both versions of the OPENXML statement to return the data.

I am pretty new to XML and OPENXML but have managed with other files okay so far, but this one has me stumped, so I would be really grateful for any help!

declare @xml XML

set @xml=N'<preliminary geographical_area_code="2" nm_number="2911" year="18">
    <sub_region>East Coast</sub_region>
      <vicinity>Aberdeen SE</vicinity>
      <feature_type>Wind farm</feature_type>
    <ordered_list Style="Arabic">
        <paragraph>Work has commenced on the construction of Kincardine Offshore Floating Wind Farm. The construction area is bounded by the following …
I'm trying to customize the Windows 10 Start Menu and Taskbar using Group Policy. I was able to use the StartLayout.xml file to successfully customize the Start Menu and push it out via Group Policy. Today I tried adding the custom Taskbar settings and it seemed to break the whole thing. The Taskbar doesn't have the layout I specified and the Start Menu doesn't have my settings either. I read and re-read the Microsoft article about it and can't see where I'm going wrong. I've attached both files: the working xml that only modifies the Start Menu and the modified xml that breaks both the Taskbar and Start Menu.

I am trying to build and XML file for USMT to include the entire AppData\Roaming and AppData\Local folders, however I cannot get the XML I built to work. I am using MigUser.xml and MigApp.xml as well as my own MigCustom.xml file to define files and data to migrate.

The command line I am using is this:
scanstate.exe C:\Migration\user  /i:MigApp.xml /i:MigUser.xml /i:MigCustom.xml /c /localonly /listfiles:userfiles.log /l:userscan.log /ue:* /ui:domain\user /v:2

Open in new window

Here is what I have so far for MigCustom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/migcustom">

    <_locDefault _loc="locNone"/>
    <_locTag _loc="locData">displayName</_locTag>

    <!-- Migrates all roaming AppData excluding some unwanted files and folders -->
	<component type="Application" context="User">
        <displayName _locID="migcustom.appdata">All files in AppData</displayName>
        <role role="Settings">
              <Include filter="MigXmlHelper.IgnoreIrrelevantLinks()">
                      <pattern type="File">%CSIDL_PROFILE%\AppData\* [*]</pattern>
                        <pattern type="File">%CSIDL_PROFILE%\AppData\LocalLow\* [*]</pattern>

Open in new window


I'm new to Python but using it to try to pull data from a XML file.  The XML file is not consistent so my code is breaking and I would like to handle the error.  How can I change my code below so that if an attribute does not exist for a given record in my XML it just ignores it and return an empty string into my variable?

XML (note that the "MonitorVersion" attribute does not exist for all records as it is is optional) :

<?xml version="1.0" encoding="UTF-8"?>

<myData locale="en_US">
 <Me Name="Bob" Age="50"/>
 <Record HealthDataType="HeartRate" sourceName="HeartMonitor" ValueData="66" />
 <Record HealthDataType="SleepHours" sourceName="SleepMonitor" [i]MonitorVersion[/i]="1" ValueData="9"/>

Open in new window

My Code (note that the code breaks when trying to populate the variable "y"

import xml.sax

class MovieHandler( xml.sax.ContentHandler ):

	# Call when an element starts
	def startElement(self, tag, attributes):

		self.CurrentData = tag

		if tag == "Record":         
			# This works
			x = attributes["HealthDataType"]

			# This does NOT work as this attribute is not present in each record
			y = attributes["MonitorVersion"]

def main():
  	# create an XMLReader
	parser = xml.sax.make_parser()
	# turn off namepsaces
	parser.setFeature(xml.sax.handler.feature_namespaces, 0)

	# override the default ContextHandler
	Handler = MovieHandler()
	parser.setContentHandler( Handler )


if __name__ == "__main__":


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