XML

20K

Solutions

13K

Contributors

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 see alert message "Process cannot access the file because it is being used by another process".
when I click the button at third time. It seems reading is okay. but when i click the button to write something inside  to the xml.
it fails. how can i resolve this issue?


 protected void Page_Load(object sender, EventArgs e)
        {
            phoneNoList.DataSource = Utility.Controller.GetUniquePhoneNo(fromPhoneNo);
            phoneNoList.DataBind();
}

  protected void sendMsg_Click(object sender, EventArgs e)
        {
		 #region add a record to all message xml
                Domain.User u = new Domain.User();
                u.fullName = fullName.Text;
                u.from = "+1" + fromPhoneNo;
                u.to = "+1" + toPhoneNo.Text;
                u.body = body.Text;
                u.dateTimeSent = DateTime.Now.ToString();
                u.direction = "outbound-reply";
                string result = Utility.XML.Add(Utility.Controller.filePathUserMessagesAll, u);
                #endregion


}

  public static string Add(string inputFilePath,Domain.User u)
        {
            XDocument doc = XDocument.Load(inputFilePath);
            XElement user = new XElement("User",
                new XAttribute("PhoneNo",""),
                new XElement("FullName",u.fullName),
                new XElement("From",u.from),
                new XElement("To",u.to),
                new XElement("Body",u.body),
                new 

Open in new window

0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

I am new to the forums and looking for some help. I will provide as much information as I can, just be patient with me.
I am looking into Installing Office 365 Pro Plus 2016 on about 150 workstations. They all currently have Office 365 ProPlus 2013 installed. 2013 was pushed out using a GPO created by the last admin using scripts and XML files. I am having issues either doing an in place upgrade OR uninstalling 2013 then installing 2016.

Here is the Install bat file that has been created;

setlocal

Endlocal

Set KEY_Name="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\O365ProPlusRetail - en-us"
Set Value_Name=DisplayVersion
Set Office16=16

for /F "usebackq tokens=3" %%A IN (`reg query %KEY_NAME% /S /v %VALUE_NAME% 2^>nul ^| find "%VALUE_NAME%"`) do (
    set ValueValue=%%A
   
)
set ValueValue1=%ValueValue:~0,2%

if not "%ValueValue1%"=="%Office16%" (
      start /D "\\DOMAIN\software\office 2016 Test\" setup.exe /configure install.xml
      ) else (goto End )
)

:End
REM md "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2016"
REM move "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\*2016.lnk" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2016\"

            
Endlocal
0
I already have model and controller that basically doing all the work I need. model is basically our domain class.
and controller is just all of combined classes that do all the thing we want like add, modify the data in xml or database.

our next is to create restful API that allow external users to use it. Do you have very simple example for us to get start it?
0
I have an application that creates an xml file with marker information.  It pulls the text for the info window, but I can't get it to show the picture links as pictures or links. When i add anything to the code to define the links, it breaks the whole map.

Here is my code snippet:
ownloadUrl("phpsqlajax_genxmlx.php", function(data) {
        console.log(data);
        var xml = data.responseXML;
        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i < markers.length; i++) {
          var name = markers[i].getAttribute("name");
          var fulladdress = markers[i].getAttribute("fulladdress");
          var beds = markers[i].getAttribute("beds");
          var type = markers[i].getAttribute("type");
          var drg = markers[i].getAttribute("drg");
          var providernumber = markers[i].getAttribute("providernumber")
          var telephone = markers[i].getAttribute("telephone")
          var owner = markers[i].getAttribute("owner")
          var ImpactofReadmissions = markers[i].getAttribute("ImpactofReadmissions")
          var ReadmissionsAdjustmentFactor = markers[i].getAttribute("ReadmissionsAdjustmentFactor")
          var PneumoniaCases = markers[i].getAttribute("PneumoniaCases")
          var COPDCases = markers[i].getAttribute("COPDCases")
          var ExcessReadmissionRatioforPneumonia = markers[i].getAttribute("ExcessReadmissionRatioforPneumonia")
          var employees = 

Open in new window

0
Hi,
We are working on the requirement.
We are getting transaction data to one staging db ( The table having clob column and store this data as xml). we need to parse this xml and insert/update data in three different tables.

xml  like this::

Batch
   document
       Field information...

Based on the xml.. we need to update
Batch Table
Document Table
Field Table


Regards,
Praven
0
Hi, when I go to a link like: https://medlineplus.gov/feeds/topics/diabetes.xml  in IE(which I hate) or Firefox(which I no longer use, but I remember it did this), it shows the results in a user-readable manner, like:
Capture.JPG
But Chrome shows it like:
Capture2.JPG
I don't want an RSS reader, I don't want to have to save feeds or subscribe, or get notifications. I just want to read the page. Is there a way to do this? Seems so silly that Chrome doesn't just do this. Thanks.
0
So I have an XML that is like this:
<document>
<component>
 <structuredBody>
  <component>   
   <section ID="something"/>      //dont render
   <id root="123"/>
   <code code="8585"/>
      Title
  <component>
   <section ID="something"/>     //dont render
   <id root="123"/>
   <code code="2222"/>
      Title 
  </component>
  <component>               //render everything starting from this component until the end of the XML
    <section ID="something"/>
    <id root="123"/>
    <code code="20"/>
      Part1
  </component>
  <component>                                       
    <section ID="something"/>      //render
    <id root="456"/>
    <code code="1"/>
      Text..
  </component>
 </structuredBody>
</component>
</document>

Open in new window


What im having trouble is that I how to start rendering starting where the code/@code='20'.
I cant use position()>1 since there could be any number of <component> varies.
0
My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<ACManifest>
	<Orders>
		<Order>
			<OrderNumber>329</OrderNumber>
			<OrderDate>7/20/2017 7:45:26 AM</OrderDate>
			<OrgUnitName>Demo_Customer</OrgUnitName>
			<UserName>demouser</UserName>
			<ShipBasis>ORDER</ShipBasis>
			<BillTo />
			<Payments />
			<ShipTo />
			<LineItems>
				<LineItem>
					<LineItemId>100045</LineItemId>
					<LineItemName>Postcard</LineItemName>
					<LineItemCode></LineItemCode>
					<Quantity>1</Quantity>
					<MailDate></MailDate>
					<FileCreationDate>7/20/2017 7:45:58 AM</FileCreationDate>
					<InventoryNumber />
					<AisleNumber />
					<BinNumber />
					<Components>
						<Component>
							<Content>ftp://ftp3.mycompany.com/329.pdf</Content>
							<FileName>329.pdf</FileName>
						</Component>
					</Components>
					<AddOns />
					<ManagedProperties>
						<KeyPair key="Additional Information Items"></KeyPair>
					</ManagedProperties>
					<SpecialInstructions>test 1</SpecialInstructions>
					<CostCenter></CostCenter>
					<MerchandiseOptions />
				</LineItem>
			</LineItems>
		</Order>
	</Orders>
</ACManifest>

Open in new window


I want to produce a CSV file that looks like this:
LineItemId,LineItemName,Quantity,FileName,SpecialInstructions
100045,Postcard,1,329.pdf,test 1

Open in new window


I am using this xslt:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no" encoding="utf-8"/>
<xsl:template match="LineItems">

<xsl:text>LineItemId,LineItemName,Quantity,FileName,SpecialInstructions</xsl:text>
<xsl:text>&#10;</xsl:text>

<xsl:for-each select="LineItem">
<xsl:value-of select="LineItemId"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="LineItemName"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="Quantity"/>
<xsl:text>,</xsl:text>
<xsl:for-each select="Component">
<xsl:value-of select="FileName"/>
<xsl:text>,</xsl:text>
</xsl:for-each>
<xsl:value-of select="SpecialInstructions"/>
<xsl:text>&#10;</xsl:text>
</xsl:for-each>

</xsl:template>

</xsl:stylesheet>

Open in new window


My result file contains this:
3297/20/2017 7:45:26 AMDemo_CustomerdemouserORDERLineItemId,LineItemName,Quantity,FileName,SpecialInstructions
100045,Postcard,1,test 1

Open in new window


Why are Elements at the top of the XML getting written to the result, and why isn't the filename getting written?
If there are resources to help me understand what I am doing wrong, please let me know. I'm new to this.  Thanks!
0
Hello,
I am using c# and MySQL. In c# I build an XML string is like below format. I am facing problem in MYSQL stored procedure.

set @xml ='<Details>
    <Levels>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>0</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>1</MAT>
            <SDV>1</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>1</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>2</MAT>
            <SDV>2</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
                        <QuestionId>1188</QuestionId>
                <QuestionId>1189</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>2</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>1</MAT>
            <SDV>3</SDV>
            <Questions>
                <QuestionId>1209</QuestionId>
                <QuestionId>1210</QuestionId>
                 <QuestionId>1199</QuestionId>
            </Questions>
        </Level>
      </Levels>
</Details>';


DECLARE tSectionId varchar(20),tWAC …
0
Oh dear experts
I need to read XML files, any advice ?

I need to put an xml in a readable page in VB,
regards
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE
LVL 4
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Word 2016/Win10:

Hi,

In a longstanding Word document, I saw the following after clicking File.

XML warning.
The doc has no macros (if that would make a difference.) Any idea what the XML represents, or how I can find out?

Thanks,
Steve
0
I have codes below and everything works fine except I get alert message below

The process cannot access the file 'c:\abc.xml because it is being used by another process

Just FYI, the xml is used for a website with around 20 users.

   public static DataTable GetUniquePhoneNo(string accountPhoneNo)
        {
            string clientPhoneNo = string.Empty;
            string inputFilePath = filePathUserMessagesAll;
            DataTable dt = new DataTable();
            dt.Clear();
            dt.Columns.AddRange(new DataColumn[]
           {
                new DataColumn("PhoneNo",typeof(string)),
                new DataColumn("Client",typeof(string)),
                new DataColumn("DateCreated",typeof(string))
           });
            XDocument xdoc = null;
            using (XmlReader xr = XmlReader.Create(inputFilePath))
            {
                xdoc = XDocument.Load(xr);
                var query1 = from t in xdoc.Descendants("User")
                             where t.Element("From").Value.ToLower() == "+1" + accountPhoneNo.ToLower()
                             select new
                             {
                                 To = t.Element("To").Value,
                                 FullName = t.Element("FullName").Value,
                                 DateTimeSent = t.Element("DateTimeSent").Value
                                 //DateTime.Parse(txtDatepicker_end.Text).ToString("YYYY-MM-dd");
                             };
     

Open in new window

0
<Details>
    <Levels>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>0</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>1</MAT>
            <SDV>1</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>1</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>2</MAT>
            <SDV>2</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>2</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>1</MAT>
            <SDV>3</SDV>
            <Questions>
                <QuestionId>1209</QuestionId>
                <QuestionId>1210</QuestionId>
            </Questions>
        </Level>
        <Level>
            <SectionId>681</SectionId>
            <RiskId>3</RiskId>
            <WAC>Test </WAC>
            <DOCReview>Test</DOCReview>
            <MAT>2</MAT>
            <SDV>1</SDV>
            <Questions>
                <QuestionId>1186</QuestionId>
                <QuestionId>1187</QuestionId>
                …
0
Hi all, could me please tell me how to create dll file using vba.net. I need to create dll file and use in word vba. I have create dll file and gave reference via word vba but Activex can't create objects error coming..

ex:
Dim tem as testing.test
Set tem = New testing.test

error coming in second line
0
I have an app that writes an XML file, then FTP's it. It normally works OK but running on a different PC I get an error: -Access-Error.png
This crash seems to happen just as it starts writing the text file. Can anyone help?
0
I have an XML file extract with names of people and other details. How do I make this data available on a form of some sorts so end users can perform all kinds of searches on the data. i. e. First Name/Last name text search or even filter the data further using drop down that users can choose from?

I am thinking of loading the XML file into an Oracle database and then display the data as a form on Oracle Apex. However I have no prior experience in Oracle Apex, so I'm assuming it has text search, drilling down features etc.

Ps - this XML data load could end up being a weekly /monthly data load.

Really appreciate your help/suggestions.

Thanks, Ben
0
i have this error in my projectAn exception of type 'System.Xml.XmlException' occurred in System.Xml.dll but was not handled in user code

Additional information: An error occurred while parsing EntityName. Line 1, position 223.
and my code is


   private void BtnShow_Click(object sender, RoutedEventArgs e)
        {
            LblCurrentVersion.Content = (new System.Reflection.AssemblyName(this.GetType().Assembly.FullName)).Version;
            //lblcurrentv.Content = Application.ProductVersion;
           
                string xmlurl = @"http://zahrapersonaccou.yourgig.ir/update.xml";
           
                XDocument xml = XDocument.Load(xmlurl);
           
                foreach (XElement element in xml.Descendants("version"))
                {
                    LblNewversion.Content = element.Value.ToString();
                }

                foreach (XElement element in xml.Descendants("Description"))
                {
                    LblTozihat.Content = element.Value.ToString();
                }
         
        }

how can i solve this error?
0
Hi, All - I need to convert XML to JSON 1-5 times a month, I want to do this on premise on a Windows or Linux server. Online conversions are not an option, doing the task manually is not an option.

I would prefer to find a free option, happy to pay a little money for software however free is best. I was thinking java, ASP - anything really.

The files will be downloaded from an FTP server and placed in a directory, which I then hope to have something pick them up to convert them. Once converted the files will be placed in a  folder.

I am looking for suggestions and ideas on how to make this happen, in the event someone out there is feeling helpful I have attached the two files that I will convert regularly that can be used to create a script.

Thanks
promotionsxml.xml
201707pb.xml
0
I have an xml file that looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<AnswerSet title="New Answer File" version="1.1">
      <Answer name="(ANSWER FILE DESCRIPTION)" save="false">
            <TextValue></TextValue>
      </Answer>
      <Answer name="(ANSWER FILE HISTORY)" save="false">
            <TextValue></TextValue>
      </Answer>
      <Answer name="City1">
            <TextValue>Los Angeles</TextValue>
      </Answer>
      <Answer name="NameFirst">
            <TextValue>TestFirst</TextValue>
....

I've done an import of xml into a SQL Server table before but I've never seen an XML file with 'Answer name' then the name of the field.  I can get so far as loading it via OPENROWSET and outputting a hyperlink, but after that, I'm lost since I don't have named elements like I'm used to seeing.
0
Want Experts Exchange at your fingertips?
LVL 9
Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

So i'm trying to parse some xml with ElementTree, but it's got smileys in what seems to be UTF-16 decimal.
it's got this `&#55357;&#56835;` in it but says it's UTF-8 in the <?xml?> tag.


How do I decode UTF-16? Is that the right question to ask?
0
Hi All,

Given SQL Server 2008R2, a table table_name and column column_name that contains the below XML (heavily mocked up), I need to write a query that returns a set navigates down Envelope > Body > MyFabulousVacation > Reservation > AirSegment, and returns a set with four rows (one for each <AirSegment>) and these columns
 
Group, Carrier, FlightNumber, Origin, Destination, DepartureTime
ArrivalTime, SupplierCode, ClassOfService, OperatingCarrier

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/wahoo/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <MyFabulousVacation xmlns="http://yabba.dabba.doo/schema/">
      <reservation Key="bkgoU0BAAA/BM8PzEHAAAA==" TotalPrice="USD569.56" BasePrice="USD56.00" Taxes="USD513.56" xmlns="http://yabba.dabba.doo/schema/">
        <AirSegment Key="bkgoU0BAAA/BI8PzEHAAAA==" Group="0" Carrier="ZZ" FlightNumber="32" Origin="HOME" Destination="HERE" DepartureTime="2017-11-14T10:45:00" ArrivalTime="2017-11-15T15:40:00" ProviderCode="1P" SupplierCode="ZZ" ClassOfService="K">
          <CodeshareInfo OperatingCarrier="ZZ" />
          <Connection />
        </AirSegment>
        <AirSegment Key="bkgoU0BAAA/BJ8PzEHAAAA==" Group="0" Carrier="ZZ" FlightNumber="7971" Origin="HERE" Destination="THERE" DepartureTime="2017-11-15T18:15:00" ArrivalTime="2017-11-15T23:35:00" ProviderCode="1P" SupplierCode="ZZ" ClassOfService="K">
          <CodeshareInfo 

Open in new window

0
Hi,

I have a contact form with an XML that loads the contact information in the contact form. I am busy adjusting this. Instead of a dropdown, I want to build an ajax life search. Can someone help with that? I like to hear it

Thanks
test.xml
test3.php
0
Hi, hoping somebody could give me a quick hand with this. Normally I would try figure it out on my own but I am on a very tight time scale and its not something I would usually deal with.

We have been given an XML file that has 2 namespaces, which I have read SSIS will not support.

I want to use an XML task to strip the first namespace. How would I go about doing this?

I have created an XML Task in SSIS, in the input I have put the link to my XML file, then in the output I just left it to "Save operation Result"

In the Second Operand I have put direct input and typed in exclude-result-prefixes="ms ns xsi"   However I am getting an error when I run the code saying it cant find any XML.

Any help / point in the right direction would be really appreciated.
0
Dear Team,

instead of every time inserting data into stored procedure  is it possible that from front end (java) we collect data for example 3 forms we have to submit data and then we collect this data into xml and finally insert into our stored procedure
0
I am calling the stored procedure using these parameters.
All but the last column (Mulitplier are varchar or nvarchar fields, so xml is fine.  How must I change things to update the multiplier field which is decimal (18,9)?

exec concord_updateDSEmatchedIndexDatatypeNotFutures @RIC='.HKCES120',
@indextype='DF',
@dtvalues='<root><dts><rtrcol>Unadjusted High (col 43)</rtrcol><dt>PH</dt><multiplier>2</multiplier></dts><dts><rtrcol>Unadjusted Last Trade (col 71)</rtrcol><dt>PI</dt><multiplier>
2</multiplier></dts><dts><rtrcol>Unadjusted Low (col 57)</rtrcol><dt>PL</dt><multiplier>
2</multiplier></dts><dts><rtrcol>Unadjusted Open (col 155)</rtrcol><dt>PO</dt><multiplier>
2</multiplier></dts></root>'

Open in new window


ALTER proc [dbo].[concord_updateDSEmatchedIndexDatatypeNotFutures] @RIC varchar(24),
@indextype char(2),@dtvalues xml
as

set nocount on 

if not exists (select 1 from DSEMatchedIndex with (nolock) where Ric = @Ric)
begin
	raiserror('RIC %s not in DSEMatchedIndex',15,127,@RIC)
	return 
end

DECLARE @ErrorMessage NVARCHAR(4000) 
DECLARE @ErrorSeverity INT 
DECLARE @ErrorState INT   

declare @rectype char(2)
if @indextype in ('CC','CS','CO')
	set @rectype = 'PT'
else
	set @rectype = 'P0'           

create table #idt (
	RIC   varchar(24) COLLATE SQL_Latin1_General_CP1_CS_AS,
	RtrColumnDesc varchar(90),	
	datatypemnem    varchar(6),
	multiplier int
)

insert #idt(                
    RIC,          
    RTRcolumnDesc,	
	datatypemnem,
	Multiplier)                
	

Open in new window

0

XML

20K

Solutions

13K

Contributors

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