Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

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

This code is a small portion of a view creation that develops a perfect answer except that one track_thing_id/thing_id combination exceeds the 4000 byte listagg limitation.  Because that one combination exceeds the 4000 character/byte limitation of listagg, I believe I need an XML conversion.  

    left outer join
           (  select mi8.track_thing_id,
                     listagg (
                            nvl (p.cipher, '')
                         || '-'
                         || mip.kellogg_nur
                         || '-'
                         || nvl (pls.situation, 'Nsitn'),
                         ', ')
                         within group (order by p.cipher)
                         as "thing/sit"
                from ml_track_thing mi8
                     join ml_track_thing_stuff mip
                         on mi8.track_thing_id = mip.track_thing_id
                     left outer join stuffstuff p on p.id = mip.endpr_id
                     left outer join lic_endpr_permit pl
                         on (    pl.endpr_id = mip.endpr_id
                             and pl.house_id = mi8.place_id)
                     left outer join lic_endpr_permit_situation pls
                         on pl.permit_situation_id = pls.id
            group by mi8.track_thing_id
            order by mi8.track_thing_id) spcl

Open in new window


So what I need from the above code is the XML equivalent..    and I am hoping the above is sufficient  for a resident expert to return the needed SQL..  And would gladly consider any alternative solution to the listagg limitation.

All pointers and suggestions appreciated ..  I have tested, and yes, there is only one combination (out of a large number) that come anywhere close to the 4000 byte limitation, and it clearly does exceed.. It is entirely possible that future data entry could cause additional  track_thing_id/thing_id combinations to exceed the limitation.
0
Free Tool: Site Down Detector
LVL 10
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

say, I have an XML response file from a third party web service.

This contains a result of some operation which, I need to display it to a client. this third party has also provided me with  css and javascript files, which I use to display the response XML in a web browser.

my question is how can i write back a XML file to a web browser?
0
Hello,

I am having trouble reading an XML response.  I am not sure if I can explain it well.  I am using XMLParse on the filecontent.

When I do this directly from the response from the web service I am using, it seems that I am getting just one chunk of XMLText instead of each piece of information with its node label.

<cfdump var="#xmlparse(httpResponse.filecontent)#">

If I show the filecontent on the screen, then copy and paste it into notepad and name it something.xml, then run XML Parse, I am able to access the different nodes.

<cfdump var="#xmlparse("test.xml")#">

Below is the filecontent that I am able to create an xml document with and read successfully.

Attached are images of the two cfdump calls.  I think the pictures should explain it.

I am not sure if this has to do with XMLParse or with the response data that is being returned to me.

Any help would be much appreciated.  I have been trying to figure this out for two days now and am exhausted...



<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ExecuteXMLResponse xmlns="http://rossinc.com/webservices/"><ExecuteXMLResult><method name="RS_BIN_TRANSFER"><database>_CONNECTSERVICE</database> <parameters><parameter> <name>ERROR_OCCURRED</name> <value>1</value> </parameter> <parameter> <name>XML_TAGS</name> <value>1</value> …
0
I need to build a set of 1 or more InfoPath documents based upon some business criteria going against a related list of recipients of the document.

I have it working using the following function.  Part of the process of building the function is to copy a base (template) XML file down from the document library, turn it into a string with one or more parameters that I insert into that string, and then write the string to content object, upload to the library and then the XML file is available and loads in InfoPath within a browser.

The form has a repeating table which if I populate the form with, the function fails after I take that XML file and use it as the template in my function.

Code follows with abbreviated XML variable as it is too long:
	 function createFile(pParam1, pParam2) {
		var clientContext;
		var oWebsite;
		var oList;
		var fileCreateInfo;
		var fileContent;
		
		var sfileName = "FileNamePrefix_" + pParam1 + "_.xml";
						
		try{
			clientContext = new SP.ClientContext.get_current();
			oWebsite = clientContext.get_web();
			oList = oWebsite.get_lists().getByTitle("RecType SubType");   
			
			var FoundFile = CheckForDoc(sfileName, false);
			var newTemplate = 
			'\n<?xml version="1.0" encoding="utf-8"?><?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:RecType-Audits:-myXSD-2017-07-01T00-23-25" solutionVersion="1.0.0.502" productVersion="16.0.0.0" PIVersion="1.0.0.0" 

Open in new window

0
I know I can do this in .Net but would like to deploy my solution in MS/SQL 2008 R2 as the processing needs to run every minute (or some such) 24/7/365

I have to read a SOURCE .xml file from disk and create/write to a DESTINATION .xml on disk

SOURCE.xml                 should always be a single <package_creation>.....</package_creation>
DESTINATION.xml       should always be a single <PackagingList>.....</PackagingList>


SOURCE.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <packaging_creation>
            <item_code>G1-000123-2</item_code>
            <packaging_code>0000014263</packaging_code>
            <quantity>2220</quantity>
            <location>Fuori</location>
      </packaging_creation>

DESTINATION.xml

      <?xml version="1.0" encoding="utf-8" ?>
      <PackagingList ImportVersion="1.0.1.1">
            <Packaging IdPackaging="0000014263" ComponentName="G1-000123-2" OriginalQuantity="2220"  />
      </PackagingList>

(indentation added for clarity)

Mapping of data (?nodes?) is

      SOURCE                        DESTINATION

      item_code            =>  ComponentName
      packaging_code  =>  IdPackaging
      quantity               =>  OriginalQuantity

A couple of days searching with "The Microsoft Search Engine" (ie: GOOGLE) has born little I can make sense of...  I have read the SOURCE into SQL using OPENROWSET but have been unable to expose the ?nodes? and their values.

I expected this to be fairly simple (I've been wrong before) but can't seem to get it wired up.

I would appreciate an example solution - at least for …
0
assume i have xml file call abc.xml

do you know any plug-in or app in c#/aspx.net that will create step by step form wizard based on the xml structure.
below we will start to read 'Notary' & 'CA' then i should have three steps

I just need some sort codes example to start.


<Sure>
      <Line>
        <Commercial>
          <Bond Name="Notary">
            <State name="CA"> 
              <Principal step="Step 1">
                <input type="text" class="" id="principalFirstName" placeholder="First Name" value=""></input>              
                <input type="text" class="" id="principalLastName" placeholder="Last Name" value=""></input>
                <input type="text" class="" id="principalMiddleName" placeholder="Middle Name" value=""></input>
                <input type="text" class="" id="principalCompanyName" placeholder="Company Name" value=""></input>
                <input type="text" class="" id="principalDBA" placeholder="DBA" value=""></input>
                <input type="text" class="" id="principalAddress" placeholder="Address" value=""></input>
                <input type="text" class="" id="principalCity" placeholder="City" value=""></input>
                <input type="text" class="" id="principalState" placeholder="State" value=""></input>
                <input type="text" class="" id="principalZip" placeholder="Zip" value=""></input>
                <input type="text" class="" id="principalPhoneNo" placeholder="Phone No" 

Open in new window

0
Hello,
I have a Dymo .label file which is XML code and contains the code required to produce a label on a Dymo Labelwriter 450 printer. I need to convert this XML file to PDF so that I can send it to www.PrintNode.com via an API so that I can print it Clientside. PrintNode will only except a PDF file. In my Server application I have copied the XML code out of the .label file and inserted into into a PDF file using iTextSharp as shown below.
The outcome is that I get a valid PDF file but when I open it , it contains the XML code from the .label rather than the formatted Label which I was expecting to see.  I am obviously missing some part of the conversion process but don't know what it is. Needless to can that if I send this file to printNode it will just print the XML text rather than the label. Any suggestions or pointers or examples would be welcome.

regards
Pat

C# Code where I insert XML into PDF document                          
                           // Create new pdf file
                            try
                            {
                                fs = new FileStream(filePath1, FileMode.Create);
                            }
                            catch (Exception ex)
                            {
                               
                            }

                            //To create a PDF document, create an instance of the class Document and pass the page size and the page margins to the 

Open in new window

0
Say, I have an XML with Namespace (example contrived for the purpose of the question).
To read the XML below, I can add a namespace manager and read the element. but if i wanted to modify, write a new element to such
XML, how do i do it?

say i want to append, <xyz:status/> element, in the following XML and save it.

string resultStr=@"<xyz:Message xmlns:xyz="http://xyz.com"><xyz:result>...</xyz:result></xyz:Message>";

XmlDocument doc = new XmlDocument();
xDoc.LoadXml( resultStr);

XmlNamespaceManager mng = new XmlNamespaceManager( doc.NameTable );
mng.AddNamespace( "xyz", "http://xyz.com" );

string result = xDoc.SelectSingleNode( "xyz:Message /xyz:result", mng).InnerText;
0
Hi

I'm writing an application which deals with messages and each message can have x number of attributes. I Need to store a "Filter" value for each attribute and would like to make the filter value list persistent once excel has been shut down.

I was hoping something like

<Message>
       <Attribute>
                  <Attribute_Name>Ignition</Attribute_Name>
                  <Filter_Value>On</Filter_Value>
       </Attribute>
      <Attribute>
                  <Attribute_Name>Ignition</Attribute_Name>
                  <Filter_Value>On</Filter_Value>
       </Attribute>
<Message>

Open in new window


I've had a search and found a few ways using xmlmap but nothing using VBA.

I'd really appreciate it if someone could point me in the right direction

Thanks
0
I need to know to to move or clone node to the specific/anywhere in the XML file. Below I have mentioned example XML

<body>
    <Paragraph>
                <Style>
                       <p1/>
                       <p2/>
                       <p3/>
                </Style>
                <Format>
                       <Style w:val="NormalWeb" />
                       <keepNext />
                       <spacing w:before="0"/>
                </Format>
                <Text>
                        <w:rPr>
                        <w:b />
                        <w:bCs />
                       <w:szCs w:val="20" />
                       <Cond>(Exact Name of Registrant as Specified in its Charter) </Cond>
                 </Text>
</Paragraph>
</body>

Using InsertBefore method I need vba DOMDocument vba code to move or clone the "<Text>" node to after the "<Style>" node. Exactly after the "Style" and before the "Format".

Again, this is a sample code only so dont anser regarding this code.
I just want to know how to move or insert node anywhere of the XML file using ObjXML.InsertBefore method
0
The Orion Papers
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

I have placed some sql statements in an XML document to load into my program.
 Example:
<Query>
    <QueryName>Exact Production Orders </QueryName>
      <DBServer>STL01APP</DBServer>
    <SQL>
          Select * from ppordfil_sql
  </SQL>
  </Query>

Simple queries load just fine but when I add a Where ColumnA < 0 I get a parse error on the < sign.

I load this XML from a file.

 xmlDoc.Load(My.Application.Info.DirectoryPath & "\sql.xml")

The program will load all nodes except this one with the < in the query.
I get a "Name" cannot begin with a "<" character, hexadecimal value XXXX Line xxx position xxx.

What would a good work around be?  (Besides not having queries with < in them.)

The queries are SQL Server type queries.

ROg
0
I get error about the computername in <Computername>%COMPUTERNAME%</ComputerName> in my unatrtended xml file when I try to apply Windows 10 image on PC. It did work when I was applying Windows 8.
0
how to use dir command to search for files that ran last one hour ?

see the below command that search for last modified xml file in folder with the date
dir /b /a-d /o-d "%BaseDir%\*.xml" 2^>NUL

i need search for one hour file so need the command to search for time
0
I have a stylesheet that I attempted to show the greek letter delta.  I have tried many ways and cannot get it to show.  This is the last attempt:
<fo:inline font-family="Symbol">
    D
</fo:inline>

Open in new window


Earlier, I attempted this:
<fo:inline font-family="Symbol">
      Δ - &#916; - &#0394; <br/>
</fo:inline>

Open in new window

0
I need to combine two XML/XSL commands.  The first of which formats the number entered/utilized:
<xsl:value-of select="inr:distanceFormat(number(@length), $xslDistancePrecision)"/>

Open in new window


The other is the Square Root funtion/call:
<xsl:call-template name="math:sqrt">
					<xsl:with-param name="number" select="($varX2 - $varX1) * ($varX2 - $varX1) + ($varY2 - $varY1) * ($varY2 - $varY1)"/>
				</xsl:call-template>

Open in new window


I tried this and it did not work.  The idea was to create a variable that would calc the square root of the number and then I could call the variable in the formatting line.:
<xsl:variable name="varSqRt1" Select="<xsl:with-param name=""number"" select=""($varX2 - $varX1) * ($varX2 - $varX1) + ($varY2 - $varY1) * ($varY2 - $varY1)""/>"/>

Open in new window

0
Hello All ,
I need a powershell script which will detect existence of a xml file under current logged on users Appdata\Roaming\SAP\Common folder , and also check the size of file which should be greater then 15kb and return as detected if found .

Thanks in advance
0
I have a XSL that I have put together and it's about done.  I need to calculate the square root of a number.  I have researched and found what I THOUGHT was the solution, but I could not get it to work.  I need assistance putting it together.  I am getting an error that is attached.  XML errorHere is the code I have:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:inr="http://mycompany.com/mynamespace" xmlns:math="http://exslt.org/math/functionssqrt/math.sqrt.template.xsl" extension-element-prefixes="math">
    <xsl:include href="../format.xsl"/>
	<xsl:import href="sqrt.xsl" />
    <xsl:param name="xslRootDirectory" select="inr:xslRootDirectory"/>
    <!-- List Coordinates with Station Report -->
    <xsl:template match="/">
        <xsl:variable name="gridOut" select="inr:SetGridOut(number(InRoads/@outputGridScaleFactor))" />
        <html>
            <head>
                <link rel="stylesheet" type="text/css" href="{$xslRootDirectory}/_Themes/engineer/theme.css"/>
            </head>
            <body>
				<xsl:apply-templates/>
            </body>
        </html>
    </xsl:template>
    <!-- Element Point Data -->
    <xsl:template match="HorizontalLine | HorizontalCircle | HorizontalSpiral">
        <xsl:variable name="startStation" select="Start/station/@internalStation"/>
        

Open in new window

0
Below codes are working but I just want to add more value. how to add value to SPName? value = "John"?

  public void _DataRequest()
        {
            XDocument xDoc = XDocument.Load("AutoParse.xml");

            var namespaceManager = new XmlNamespaceManager(new NameTable());
            namespaceManager.AddNamespace("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
            namespaceManager.AddNamespace("ComparativerRater", "http://schemas.datacontract.org/2004/07/ComparativerRater");
 

            XElement password = xDoc.Descendants(XName.Get("Password", @"http://schemas.datacontract.org/2004/07/ComparativerRater")).FirstOrDefault();
            password.SetValue("S8dfasdfasr3c9eFm");

            XElement userName = xDoc.Descendants(XName.Get("UserName", @"http://schemas.datacontract.org/2004/07/ComparativerRater")).FirstOrDefault();
            userName.SetValue("SuredfasdfasdfCoadsfds");

	    // how to add value to SPName? value = "John"

            Response.Write(xDoc); 
        }

Open in new window


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
  <soapenv:Header>
    <SecurityHeader>
      <Password xmlns="http://schemas.datacontract.org/2004/07/ComparativerRater"></Password>
      <UserName xmlns="http://schemas.datacontract.org/2004/07/ComparativerRater"></UserName>
    </SecurityHeader>
  </soapenv:Header>
  <soapenv:Body>
    <tem:GetRate>
      <tem:requestXml>
        <ACORD>
          <SignonRq>
            <SignonPswd>
              <CustId>
                <SPName></SPName>
               </CustId>
	   </SignonPswd>
 </SignonRq>
</ACORD>
 </tem:requestXml>
    </tem:GetRate>
  </soapenv:Body>
</soapenv:Envelope>

Open in new window

0
The codes below is working if I removed xmlns inside of xml. I think it has namespace issue but I do not know how to fix it.
Please help. Thanks.


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
  <soapenv:Header>
    <SecurityHeader>
      <Password xmlns="http://schemas.datacontract.org/2004/07/Rater"></Password>
      <UserName xmlns="http://schemas.datacontract.org/2004/07/Rater"></UserName>
    </SecurityHeader>
  </soapenv:Header>
  <soapenv:Body>

  </soapenv:Body>
</soapenv:Envelope>

public void _DataRequest()
        {
          
                       // Load the XML document from the file system
            XDocument xDoc = XDocument.Load("C:\\Users\\Documents\\Visual Studio 2015\\Projects\\WebApplication5\\WebApplication5\\Test\\AutoParse.xml");
            XElement password = xDoc.Descendants("Password").FirstOrDefault();
            password.SetValue("sadfasdf");
            Response.Write(xDoc);              
        }

Open in new window

0
How to Use the Help Bell
LVL 10
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

I have c# codes to call xml but get alert. Not sure how to fix it.

The ':' character, hexadecimal value 0x3A, cannot be included in a name.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
  <soapenv:Header>
    <SecurityHeader>
       <firstname>{test}</firstname>
    </SecurityHeader>
  </soapenv:Header>
  <soapenv:Body>
  </soapenv:Body>
</soapenv:Envelope>

  public void _DataRequest()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("C:\\Users\\user\\Documents\\Visual Studio 2015\\Projects\\WebApplication5\\WebApplication5\\Test\\AutoParse.xml");

            StringWriter sw = new StringWriter();
            XmlTextWriter tx = new XmlTextWriter(sw);
            doc.WriteTo(tx);
            string xml = sw.ToString();


            XDocument xDoc = XDocument.Parse(xml);
            XElement quote = xDoc.Element("soapenv:Envelope").Element("soapenv:Header").Element("SecurityHeader");
            quote.Element("firstname").SetValue("John");            
            Response.Write(xDoc);
        }

Open in new window

0
Given the below data, I want to be able to return just the values (i.e. >(-4:00) EDT< or >Eastern Daylight Time<) when the items within node_A may be in any order (thus seemingly negating the value method).  I'd like to be able to do it returning the value directly, and not reliant on variable string length like I do in the 'Query_Method_Substring' below.

<Node_A>   --The items below could be in any order
     <KVP K="5" D="TimeZoneDescription">Eastern Daylight Time</KVP>
     <KVP K="6" D="TimeZoneAbbreviation">(-4:00) EDT</KVP>
     <KVP K="4" D="Version">2.0</KVP>
</Node_A>

Also, is there a good online reference for this structure?  How is this xml structure described?
I want to read up.  
After I learn to query it cleanly, I want to figure out how to modify the values.  (i.e. change -4 EDT to -5 EST)
Something like: 'Data.modify(''replace value of (/Root/Node_A/KVP/text())[2] with ("'+@NewValue+'")'')', but again where it could be in any position, not position [2] as it is here.


Thank you so much.

DECLARE @Table TABLE (Data XML) 
INSERT INTO @Table
     SELECT '<Root>
               <Node_A>
                 <KVP K="5" D="TimeZoneDescription">Eastern Daylight Time</KVP>
                 <KVP K="6" D="TimeZoneAbbreviation">(-4:00) EDT</KVP>
                 <KVP K="4" D="Version">2.0</KVP>
               </Node_A>
             </Root>'

SELECT Data, data.value('(/Root/Node_A/KVP)[2]', 'varchar(50)') AS 'Value_Method_When_2nd_Position'
           

Open in new window

0
Is it true that XslCompiledTransform is the solution?  Any examples?  I tried to use XslCompiledTransform in my c++ code but compiling failed. I don't know how to enable CRL in my VS 2002.  Please help.
0
find /i "error"  - this command finds error word inside the xml file , but i need to find the word Status state="Error" or "ERROR"

for example
<Object type="project" />
 <Status state="ERROR" />
<ErrorInformation>
                            <Severity>WARNING</Severity>
                            <Description>hello</Description>
                        </ErrorInformation>

I want  to find  <Status state="ERROR" /> this but this command find /i "error" will also find error in </ErrorInformation>.


could you helpmw
0
I need some code that will allow me to read an xml document that several levels of nodes with attributes and ultimately place these values in a data table.
0
Without using cursor, I need to use the loop condition to fetch the files from Table and process

CREATE TABLE #directory (  
  Subdirectory nvarchar(2000),  
  depth int,  
  [file] int  
)  
INSERT INTO #directory  
EXEC xp_dirtree 'C:\Test\Incoming',1,1  

select * from #directory  
WHERE [file] = 1  
AND RIGHT(subdirectory, 4) = '.xml'

Open in new window



I get list of xml files in the #directory.

I need a loop condition to fetch file by file .. ( Not the cursor )
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).