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 had this question after viewing Change a specific key value in app.config file with another value..


I have a very similar issue but the solution provided to the question above is not working for me. The .xml file that I want to update has entries like the ones below. I need to update some of the entries not all. The values that I will provide need to be stored as variables, not hard coded.


<?xml version="1.0" encoding="utf-8"?>
<parameters>
  <setParameter name= "MachineValidationKey" value="" />
  <setParameter name= "Smart Card Auth URI" value="https://localhost/SmartCardAuthService/" />
  <setParameter name= "MachineDecryptionKey" value="" />
</parameters>


My code (based on the previous answer) is below. Is the "add[@key]" specific to the config file or is that a construct for the SelectSingleNode?  


$filename = 'server1.xml'

$XPath = "parameters/setParameter/add[@key='MachineValidationKey']"

#$XPath = "parameters/setParameter/add[@name='MachineValidationKey']"

$Attribute = "value"
$machinekey = 'SecretString123'

$xml = [xml] (Get-Content -Path $filename)

#$xml.SelectSingleNode($XPath).SetAttribute($Attribute,$machinekey)

$xml.SelectSingleNode("parameters/setParameter/add[@name='MachineValidationKey']").SetAttribute("value", "$machinekey")

$xml.Save($filename)


But is resulting in the …
0
I'm running a request that should return orders that are processing.
However, when I change the status in WooCommerce to On Hold, or something other than Processing - I still get the previous results, even if new orders are marked Processing.

Sometimes this clears up if I wait awhile.  If I test the same results in PostMan - i get the correct results.

Here's my code for getting the data:

Function WRequest(URL As String, method As String, POSTdata As String) As String
        Dim responseData As String = ""
        Try
            Dim cookieJar As New Net.CookieContainer()
            Dim hwrequest As Net.HttpWebRequest = Net.WebRequest.Create(URL)
            hwrequest.CookieContainer = cookieJar
            hwrequest.Accept = "*/*"
            hwrequest.AllowAutoRedirect = True
            hwrequest.UserAgent = "http_requester/0.1"
            hwrequest.Timeout = 60000
            hwrequest.Method = method
            If hwrequest.Method = "POST" Then
                hwrequest.ContentType = "application/x-www-form-urlencoded"
                Dim encoding As New Text.ASCIIEncoding() 'Use UTF8Encoding for XML requests
                Dim postByteArray() As Byte = encoding.GetBytes(POSTdata)
                hwrequest.ContentLength = postByteArray.Length
                Dim postStream As IO.Stream = hwrequest.GetRequestStream()
                postStream.Write(postByteArray, 0, postByteArray.Length)
                postStream.Close()
            End If
          

Open in new window

0
Hi experts

We have 200+ AutoText entries stored in a custom Word template (Sites.dotm) and also need these to be available in Outlook. We add the entries in Word. Then we close Outlook and Word, delete NormalEmail.dotm, then copy Sites.dotm and rename it as NormalEmail.dotm. When we start Outlook again, the AutoText entries are available. All as planned. The modified template is then deployed through a login script.

However, on a couple of occasions when we have done this, Out of Office will no longer function in Outlook. Initially, the thought was that it was due to corruption in Sites.dotm. However, we have re-built this template several times now, and checked the xml part (\glossary\documents.xml) which does not indicate any errors.

Also, we have tried breaking the AutoText entries in the template into blocks, as part of an exercise to determine where something may have gone wrong e.g. 1-50, 51-100 etc. This gives unreliable results - sometimes OoO works correctly but, if you drop and reload the template, it does not necessarily work a second time.

It is possible to set OoO from a mobile but I understand why that would be the case.

The version of the template we use in Word does not exhibit any issues at all.

Does anyone have any answers or suggestions regarding this behavior, please?

Many thanks in advance.
0
I am looking for an RSS Feed Web Part for my modern SharePoint Online tenant.  

In SharePoint 2010 I have a web part that pulls in XML from an RSS Feed and allows me to write my own custom XSLT to display in how I want to.  

I do not see this ability in SharePoint Online.  Any ideas on how to pull in XML from an RSS Feed and display using custom XSLT?

Is this something that Microsoft wants us to use the SPFX for and create new functions, or do we need to build our own web parts or buy 3rd party web parts for?
0
I have XML data set stored in SQL table.

<CanvasResult>
  <TotalPages>1460</TotalPages>
  <CurrentPage>1</CurrentPage>
  <Submissions>
    <Submission Department="Admin Department" Id="9658577">
      <Form Id="923663">
        <Name>Jobsite Visit</Name>
        <Status>retired</Status>
        <Version>9</Version>
      </Form>
      <Date>2015.01.05 16:34:33</Date>
      <DeviceDate>2015.01.05 16:34:25</DeviceDate>
      <UserName>dsimmonds@anthonysylvan.com</UserName>
      <FirstName>Dwayne</FirstName>
      <LastName>Simmonds</LastName>
      <ResponseID>916C8489-7B43-4A3A-9E34-A25BDA30A502</ResponseID>
      <No. />
      <SubmissionNumber />
      <Sections>
        <Section>
          <Name>Jobsite Check-In</Name>
          <Screens>
            <Screen>
              <Name>Jobsite Check-In</Name>
              <Responses>
                <Response Guid="84DC8BCB467702537272B38478F9711F05F58846">
                  <Label>Customer Name</Label>
                  <Value>Johnson</Value>
                  <Type>Text Box</Type>
                </Response>
               <Response Guid="C4118DB4E6DA52682A565CBC6D1959359A8B642A">
                  <Label>Job #</Label>
                  <Value>403408</Value>
                  <Type>Text Box</Type>
                </Response>

                <Response Guid="429E672DE3402BC86ABA892731B0BB838BFB25AE">
                  <Label>GPS </Label>
                  …
0
I need xpath for below (root tag) code ::


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rootelement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="index.xsd">

Open in new window

 
   <compound>
       
       <name>FooBar</name>
       
        <member>
           
            <name>Something</name>
       
       </member>
   
    </compound>

</rootelement>
0
Hi Experts,

I have a client MS Access 2010 app that loads reports in Preview. Once loaded they used to have a button that allowed them to Export to Excel. Like this...

With the Export to Excel Option
But, for security reasons, I'm using a customized USysRibbons table to hide the Privacy Options from the end users. Here's the XML code:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
      <ribbon startFromScratch="false">
      </ribbon>
      <backstage>
      <button idMso="ApplicationOptionsDialog" visible="false"/></backstage>
      </customUI>

Open in new window



And now they no longer have the option to Export to Excel from their Print Preview menu. Take a look...

Without Export to Excel option
I'd like them to get that option back. Can any one direct me on how to do this? Is there a modification to the XML Code that would do that?

Thanks,
Eddie
0
What tools do you use to read Email DMARC XML files?
0
I need help on performance issue which we are facing.

Users will click on createXML then xml of size 20 MB will be saved in CLOB. This XML file has data for 10 reports.
When user click on ViewXML button, then we are showing this xml file in tabular format on browser. While showing, we show data for first report and users have provision to change report type in dropdown value. Issue is when report type is changed , application is going to not responding mode as it is searching specfic report type data from 20 MB file and showing on browser.

Existing code: On click of viewxml button, system is retrieving whole 20MB file from db (CLOB) and saving into physical shared location then code is searching for specific report type data from that 20 MB file and displaying specific report type data. It is taking huge amount of time as it is saving whole xml file (20 MB) into physical shared location and searching for specific report type data from that 20 MB file.


After code change: i have changed code to get specific report type data from CLOB. On click of viewxml button, system is retrieving only specific report type data from db(CLOB) and saving into physical shared location only data related to specific report type.  Then displaying specific report type data in a browser.It is faster now as it is retrieving only specific report type data instead of reading whole xml file.

But the issue after code change is for 2 report types data is of 5MB then it is taking around 10 …
0
I try to pass xml string using ajax to aspx / method.Do you see anything wrong in the following codes?
For some reasons, It does not do anything.


 function submitXML()
        {                
        var elem = document.getElementById('aspnetForm').elements;
        var xmlTemplate = '<?xml version="1.0"?><formData key='+document.getElementById("key").value+'>';
        for(var i = 0; i < elem.length; i++)
        {
            xmlTemplate = xmlTemplate + '<'+elem[i].id+'>' + elem[i].value +'</'+elem[i].id+'>';          
        } 
            xmlTemplate = xmlTemplate + '</formData>';
        alert(xmlTemplate);
        $.ajax({
        type: "POST",
        async: false,
        data: '{namestring:"' + xmlTemplate + '"}',
        url: "redapp.aspx/PostDataXML",        
        contentType: "application/xml; charset=utf-8",
        dataType: "xml",
        success: OnSuccess,
        failure: function(response) {
            alert(response.d);
        }
        });
        }

Open in new window


    [System.Web.Services.WebMethod]
    public static string PostDataXML(string namestring)
    {
        string dataList = namestring;         
        ezMail.Send("email@google.com", "Case No. 123", "org: " + namestring + "<br>" + "new: " + dataList);
        return "Success";
    }

Open in new window

0
I have the following codes to loop each of the item within the html form
and inside of the javascript. I want to generate xml string like
<xml>
<tranid id="test">
<firstname>John</firstname>
<lastname>Smiths</lastname>
</tranid>
</xml>

1. How can I do that in javascript?
2. When the xml string is passed back to c# code behind, will it create any security issue because of xml tag?

<div class="12u">
                    <div class="row"> 
                    <div class="6u"> 
                    <label id="lblfirstname" for="firstname"></label>
                    <input type="text" id="firstname" placeholder="first name" required />
                    </div>
                    <div class="6u"> 
                    <label id="lbllastname" for="lastname"></label>
                    <input type="text" id="lastname" placeholder="last name" />
                    </div>
                    </div>
                    <label id="lblcompanyname" for="companyname"></label>
                    <input type="text" id="companyname" placeholder="company name" />

                    <label id="lbladdress" for="address"></label>
                    <input type="text" id="address" placeholder="address" />

                    <div class="row"> 
                    <div class="6u"> 
                    <label id="lblphoneno" for="phoneno"></label>
                    <input type="text" id="phoneno" placeholder="phone number"  />
                        </div>
            

Open in new window

0
Am trying to get from SQL to XML however have to format this correctly or it will not work.

Below is the query I run -

select employee_name as Name ,'OCI Associates' as [CompanyName],'Mr' as Salutation ,
 LEFT(employee_name,CHARINDEX(' ',employee_name + ' ')-1) as FirstName,  REVERSE(LEFT(REVERSE(employee_name),
CHARINDEX(' ',REVERSE(employee_name))- 1)) AS LastName

 
  from EMPLOYEELIST 
for xml raw('CustomerAdd') , ROOT('CustomerAddRq'), ELEMENTS

Open in new window


This is what I get  -

      <CustomerAdd>
        <Name>Zohreh Kazeminia</Name>
        <Salutation>Mr</Salutation>
        <FirstName>Zohreh</FirstName>
        <LastName>FAKELASTNAME</LastName>
      </CustomerAdd>
      <CustomerAdd>
        <Name>Phillip Lyon</Name>
        <Salutation>Mr</Salutation>
        <FirstName>Phillip</FirstName>
        <LastName>FAKELASTNAME</LastName>
      </CustomerAdd>

Open in new window


What I need to get is the following

      
 <CustomerAddRq>
<CustomerAdd>
        <Name>Zohreh Kazeminia</Name>
        <Salutation>Mr</Salutation>
        <FirstName>Zohreh</FirstName>
        <LastName>FAKELASTNAME</LastName>
      </CustomerAdd>
 </CustomerAddRq>
 <CustomerAddRq>
      <CustomerAdd>
        <Name>Phillip Lyon</Name>
        <Salutation>Mr</Salutation>
        <FirstName>Phillip</FirstName>
        <LastName>FAKELASTNAME</LastName>
      </CustomerAdd>
 </CustomerAddRq>

Open in new window


I am not sure how to get another "Root" elemnt down there.
0
Hi,

Below XML file is stored in a CLOB in oracle database in one column.


SELECT XML1 FROM  T1 WHERE Date1 = '30-SEP-2019';

XML1  is of CLOB data type which has content as below:

Can somebody help on a query for expected output from CLOB. How to retrieve only <a1> content along with top root tag.

I got below query but it is not retrieving along with root element: Please help to modify below query to get <a1> results along with root element. Thank you

SELECT x.XML1 FROM T1 XMLTable(''/fiveGSubmission'' passing xmltype(XML1) columns XML1 xmltype path ''a1'') x where Date1 = '30-SEP-2019';

XML File as below:

<?xml version="1.0" encoding="UTF-8"?>
<fiveGSubmission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="5GSchemaCS.xsd">
  <header version="1">
    <R1 listingExchange="XSWX">CS</R1>
    <Date>2019-09-30</Date>
  </header>

<a1>
<a111>123</a111>
<b111>345</b111>
</a1>


<a1>
<a111>234</a111>
<b111>567</b111>
</a1>

<a1>
<a111>890</a111>
<b111>543</b111>
</a1>


<a2>
<a111>890</a111>
<b111>543</b111>
</a2>

<a3>
<a111>890</a111>
<b111>543</b111>
</a3>

</fiveGSubmission>


Expected Output is as below:

<?xml version="1.0" encoding="UTF-8"?>
<fiveGSubmission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="5GSchemaCS.xsd">
  <header version="1">
    <R1 listingExchange="XSWX">CS</R1>
    <Date>2019-09-30</Date>
  </header>…
0
I'm trying to connect SalesForce to a published webservice.  The way the appserver is configured, I need to generate a connect request, which returns a uuid, then generate the actual request to get / update information, then generate a logout request.

I've been able to create the Apex class from the WSDL, but I'm mystified on how to even generate the login request to get the UUID - the online examples I have seen don't seem to match this particular WSDL.

I've attached a simple example WSDL - any help or suggestions on how to write an Apex class to login, retrieve data, and logout would be GREATLY appreciated.

Thanks,

-Dan
xxsfptexp.wsdl
0
Hi

We are trying to work out which of the xml files have relevance for Cisco Anyconnect?  

Our VPN clients appear to be downloading a preferences.xml file on first connection to the ASA to %localappdata%\cisco\cisco anyconnect secure mobility client\.  It also seems to be pulling down VPNProfile.xml to C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile

Both have values that appear applicable.

Suggestions?

Thanks
0
I am creating a pl/sql pkg for transportable tablespace using data pump.Source database has one XML type table and I don't need to import that XML type table. Is there any way to exclude the XML type table at the time of exporting the transportable tablespace or at the time of import it? How to do that?
0
So I have a stored procedure that has a table variable as a parameter that needs to effect change on a table tblTagObject.

Basically objects in our system can have tags assigned to them on 3 levels
1. Vessel
2. Fixture (there can be multiple)
3. Voyage

90% of the time they are leveled like this.

So when a user introduces a new tag and/or a new tag relationship. it needs to propagate through the user defined inheritance if the user selects updatechildren. ex..Adding a new vessel tag causes the all the fixture tags and voyage tags to be updated. Adding a new fixture tag causes the voyage tag to be updated etc..

The previous designer utilized hard to read/debug looping and recursion and it doesn't always work and no one knows why.

So i took a step back and took the table object being passed in

Here is the below SQL Script for the source object


DECLARE @UserID INT = 2477
DECLARE @UserCompanyID INT = 247
DECLARE @VoyageID INT = 83008

DECLARE @ScopeTagXml XML = '<root>
                              <tagObject>
							     <TagObjectDto>
								    <tagObjectId>55160</tagObjectId>
									<objectId>2021</objectId>
									<tag><tagId>638</tagId></tag>
									<tagCategoryScope>
										<tagCategoryScopeId>529</tagCategoryScopeId>
										<tagScope>
											<scopeName>Operator</scopeName>
										</tagScope>
										<updateChildren>1</updateChildren>
                                    </tagCategoryScope>
									

Open in new window

0
I have an assignment to generate an XML sitemap for my school exercise website and link it to the website. This seems pretty easy. For a test, I used XML-Sitemaps.com to generate an XML file for my art website, www.allafox.com. It crawled the site and gave me the xml:

sitemap-allafox.jpg

However, when I pass XML-Sitemaps.com the URL of my school exercise website (http://nova.umuc.edu/~ct386b12/exercise3/index.html) I am told it scanned one page, and it gives me basically an empty xml file:

<?xml version="1.0" encoding="UTF-8"?>
-<urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->
</urlset>

This is very puzzling to me. Can anyone please help me figure out why it doesn't work on my school exercise website?
0
I have built a script which can create a DateField for a list.  Works fine.  However,  I can only set the DisplayName and do not seem to be able to set the Internal Name.  I have tried setting a StaticName in the xml as well, and when I look at the list, the column is there, but the internal name is not.

Here is the code:

$FieldXML= "<Field Type='DateTime' Name='$ColumnName' ID='$([GUID]::NewGuid())' DisplayName='$ColumnDisplayName' InternalName='$ColumnInternalName' Required ='TRUE' Format='DateOnly' FriendlyDisplayFormat='Disabled'></Field>"		

#Add DateTime Field to list
Add-PnPFieldFromXml -FieldXml $FieldXML -List "SomeListName"

Open in new window

0
Is there a way to create a common data dictionary from and XML file dynamically?
0
My company has recently carried out a purge of our Inventory Assets and have now restarted the process of auditing our PCs through GP which pushes out the Audit executable. Checks in Inventory shows that for some of our PCs, the User field is populated with data which is not current whereas others displays the correct / last logged on User. There are multiple cases where the User field displays the names of employees who have not logged onto the PCs in years. The XML file in the data folder on the TrackIT server produced by the audit also contains this stale / incorrect Username.

Troubleshooting efforts:
-We’ve tried initiating the audit from within Inventory and tried manually running the Audit executable locally on the affected PCs
-Renaming the TrackitAudit.id located in the root directory of the affected PCs.
-Replacing the Auditcfg.ini located on the server’s root folder

None of these resolved the issue.  Any thoughts would be appreciated.
0
Getting this error when trying to connect to exchange managment shell in exchange 2013: "WinRM cannot process the request because the input XML contains a syntax error".
What has been done so far:

Exchange server and DC both are on ESXI VM hence checked the time sync and re-sync the time again between DC and exchange VM and host.
Checked the certificates and default websites in IIS manager and getting blank page when browsing the powershell Vdir.
Updated the exchange to latest CU and also the windows server to latest patch.
Ran updatecas.ps1.
replaced the web.config file with that of the working exchange server.
there are two exchange servers in the environment.
Checked the WinRM service and it is running fine.

Any help in this will be appreciated.
0
Hi, how to search and filter (autocomplete) a text box from the following xml file using php, jquery or javascript?

<?xml version="1.0" encoding="utf-8" ?>
<iata>
    <iata_airport_codes>
        <airport>Aalborg, Denmark </airport>
        <code>AAL</code>
    </iata_airport_codes>
    <iata_airport_codes>
        <airport>Aalesund, Norway </airport>
        <code>AES</code>
    </iata_airport_codes>
    <iata_airport_codes>
        <airport>Aarhus, Denmark - Bus service </airport>
        <code>ZID</code>
    </iata_airport_codes>
    <iata_airport_codes>
        <airport>Aarhus, Denmark - Tirstrup </airport>
        <code>AAR</code>
    </iata_airport_codes>
    <iata_airport_codes>
        <airport>Aasiaat, Greenland </airport>
        <code>JEG</code>
</iata>

Open in new window


Much like the function in this page, except my xml file (above) has multiple sub-elements:
https://phppot.com/jquery/jquery-autocomplete-with-xml-data-source

Thanks in advance
0
how to check .xls file is based on xml or word file because in both extension is .xls . i have a xml file having extension .xls how to check the format because if i check extension its always come like .xls .
0
I've made progress with this scrapy script but cannot get the full lyrics to be within the title and genre grouping of the xml file. I have two classes, one for the main page to grab the title, composer, shortened lyrics, and genre and the other class function (all_lyrics) follows the title link to get the full lyrics.  I've included a XML file and screen shot to show you how the FULL LYRICS is not getting grouped with the correct section but is grouped completely separate.  The full lyrics should be under lyrics.  The function named PARSE runs first and calls out to the all_lyrics function to get the complete lyrics and chords.  The issue is getting all_lyrics to return or yield the results back to the PARSE function so that I can get all the data under the correct xml schema grouping.

-------start of code--------------
import scrapy
import re
from ..items import HopamItem, HopamItem_lyrics

class hopamspider(scrapy.Spider):
    name = 'hopam_or'
    page_number = 10
    start_urls = ['https://hopamviet.vn/chord/']
    custom_settings = {'DUPEFILTER_CLASS': 'scrapy.dupefilters.BaseDupeFilter'}

    def all_lyrics(self, response):
        global items
        items = HopamItem()
        items['full_lyrics'] = response.xpath("//div[@id='lyric']/text()").extract() #no yield here!!!
        yield items


    def parse(self, response):
        items = HopamItem()
        x = 0
        xy = 0
        all_hopam = response.xpath("//div[@class='col-md-12']")
        

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