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'm returning data from an ajax request as json.
I have two queries that I execute when the request is made and the result is being sent back together as one variable ($vehicle).
Something like this:

My first query gets the various customer service reps for a given dealer using:

$all_csr = DB::table('users')
                  ->join('dealerships', 'users.dealership_id', '=', 'dealerships.id')
                  ->select(DB::raw('CONCAT(users.first_name, " ", users.last_name) AS csr'),'users.id')
                  
            ->where(function ($query) use($dealership) {
                  $query
                  ->where('users.dealership_id', $dealership->id)
                  ->whereNull('users.deleted_at')
                  ->where('users.banned', 0)
                  ->where('users.position_id', 'service_advisor');
                  })
            ->orWhere(function($query) use($dealer) {
                  $query
                  ->where('users.dealership_id', $dealer)
                  ->whereNull('users.deleted_at')
                  ->where('users.banned', 0)
                  ->where('users.position_id', 'service_manager');      
                  })
            ->orWhere(function($query) use($dealer) {
                  $query
                  ->where('users.dealership_id', $dealer)
                  ->whereNull('users.deleted_at')
                  ->where('users.banned', 0)
                  ->where('users.position_id', 'fixed_operations_manager');      
                  })
            ->get();

A second query is being returned from an API as xml for a given vehicle and I process something like this into a variable named $vehicle:

$obj = SimpleXML_Load_String($xml);

$vehicle = $obj->s_Body->RepairOrderContactVehicleGetResponse->Items->RepairOrderContactVehicle;

Lastly so I can …
0
Cloud Class® Course: Python 3 Fundamentals
LVL 12
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

I have some XML data that looks something like this:
<A>
    <B>
        <C href="#hello"/>
    </B>
    ...
    <X id="hello">
        <Y>
        ...

Open in new window

I'm running an XSLT 2.0 transformation, and I'm on node <Y>. I know there's a parent node <X> above me with an id= attribute, and I suspect there's a section <B> above which has  a bunch of child nodes, not necessarily <C> nodes, they may be anything, but they may have an href= attribute that points to the <X id=...> above me.

I now want to test if the id= above me matches any href= in section <B> above. (To make it simple there's only one level below <B>.)

[Earlier when I was on node <X>, I was able to write the following test:]
<xsl:when test="/A/B/*[./@href = current()/concat('#',@id)]

Open in new window

Pretty close to what I now need, except I need to replace current() with parent(), or parent::, and that's where I'm losing the syntax.
0
I want to test a group returned from a "for-each-group" to see if it consists of a single node which is a processing-instruction.

Currently in the choose statement, the first when and second when work. The second when tests for a blank node.

The third when attempts to test for a processing-instruction, but it does not work.

I need some syntax that will detect a processing instruction.

<xsl:for-each-group select="node()" group-adjacent="...">
  <xsl:choose>
    <xsl:when test="current-grouping-key()">
      <xsl:apply-templates select="current-group()" mode="..."/>
    </xsl:when>
    <xsl:when test="count(current-group()) eq 1 and current-group()/self::text() and not(normalize-space(current-group()))">
     <!-- skip blank nodes -->
    </xsl:when>
    <xsl:when test="count(current-group()) eq 1 and current-group()/self::processing-instruction()">
      do special stuff...
    </xsl:when>
    <xsl:otherwise>
         do stuff...
    </xsl:otherwise>
  </xsl:choose>
</xsl:for-each-group>

Open in new window

The input might be:
<block>
  
        <section>
          ...
        </section>
        <section>
          ...
        </section>

    <?foo bar1?>
  
        <section>
          ...
        </section>
        <section>
          ...
        </section>

    <?foo bar2?>

        <section>
          ...
        </section>
</block>

Open in new window

0
I have a XML file which looks like this:
<block>
  
    <?foo bar1?>
  
        <section>
          A
        </section>
        <section>
          B
        </section>

    <?foo bar2?>
  
        <section>
          C
        </section>
        <section>
          D
        </section>

</block>

Open in new window

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

C
D
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>

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

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?
0
Hi can i use hard disk files to check if an android app works?


well i have this xml in Android Studio:

<Button
        android:id="@+id/newbutton"
        android:layout_width="200dp"

        android:layout_height="49dp"
        android:layout_marginRight="48dp"
        android:layout_marginTop="216dp"

        android:onClick="Work"

        android:text="Click me"

        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageView
        android:id="@+id/imageview"
        android:layout_width="317dp"


        android:layout_height="173dp"

        android:layout_marginRight="16dp"


        android:layout_marginTop="16dp"
        app:layout_constraintRight_toRightOf="parent"

        app:layout_constraintTop_toTopOf="parent" />

Open in new window


and this code

 public void Work(View view)
    {


      ImageView imageView = findViewById(R.id.imageview);


      Bitmap bmp = BitmapFactory.decodeFile("C:\\Users\\Roald Gallowey\\Pictures\\data.jpg");

      imageView.setImageBitmap(bmp);









    }

Open in new window


but every time i start th simulator and the app it doesnt show me my image?

Where am i wrong?
0
JavaScript,PHP,Python, XML

I have read that JavaScript is Front End, but what does that mean in a development standpoint?.  Does the Developer change the Webpages in an automation way on the web server?
I am not sure how Javascript is used in the business world ,whether it is installed on the Server(windows server or Linux) or on a workstation( windows 7)
Let's say we have Javascript installed on Windows Server , then web server is installed on the same box(windows server), then JS will automate the web pages that got generated in the web server. is that the Front End

Back End, probably they mean the Program language used such as PHP or Python or Java, will use  the Web Server as well as the Database( MSSQL,MySQL,SQLLITE.etc...)

I threw in this question XML, because I am not sure if it gets created automatically or a developer has to manually write it like he/she will write HTML

Thank you
0
Is there any way to convert this XML document to Excel.  The trick is that the formulas do not transfer so is there a way someone is able to do it or show me how.

Much appreciated for whatever you can provide as this seems like a difficult task.
XML-doc.xml
0
I need some help with the below code.  I have a custom XML feed. Originally the feed was showing the contents of <drivertype> as a html link.  So got the code below to strip out the the hyperlink.

A problem i'm noticing now though, is <drivertype> can in a few instances have 2 values (i.e Comapny and Team).  When they show up in the feed they are being displayed like this :

<drivertype>
<![CDATA[
Company<a href="https://cretecarrier.com/?taxonomy=job_listing_category&#038;term=team" rel="tag">Team
]]>
</drivertype>

Open in new window


how could i modify the below code, so that if the contents has 2 values, it will display like Comapny, Team. Or something similar, just so it's it's not broken. <ul><li>Company</li>li>Team</li></ul>


link to the feed
<?php
	$mystr=get_the_term_list( $post->ID, 'job_listing_category');
	$temp=strpos($mystr,">");
	$drivertype=str_replace("</a>","",substr($mystr,$temp+1));
?>
    <drivertype><![CDATA[<?php echo $drivertype; ?>]]></drivertype>

Open in new window

0
Hi,
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


BAnders
0
An XML document can be either attribute centric or element centric.  I can see that an element-centric document is more hierarchical than an attribute-centric one but is this the only reason why it has been designed like this ?  Are there any other reasons why a developer would choose one over another ?
0
Cloud Class® Course: Microsoft Windows 7 Basic
LVL 12
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

I'm trying to get the name of my custom taxonomy to display inside my RSS feed.


I've managed to display it, but it displays it as a hyperlink, i just want to output the name and that's it.

This is what is displaying
<drivertype>
<![CDATA[
<a href="http://cretecarrier-070618.local/blog/fleet-type/dedicated/" rel="tag">Dedicated</a>
]]>
</drivertype>

Open in new window


This is the code im using
<drivertype><![CDATA[<?php echo get_the_term_list( $post->ID, 'fleet_type') ?>]]></drivertype>

Open in new window


Just want it to display, "Dedicated" or "Regional" or "OTR".
0
I'm trying to get an xml feed to work.  The following code below works, but is pulling in normal posts.  I want to only pull a custom post type called "job_listings'. How would i modify this script, so it will only pull "job_listings" ?

<?php
/**
 * Template Name: Custom AllTruckJobs RSS Template - cretefeed
 */
 
$limitCount = 7; // The posts limit to show
$posts = query_posts('showposts=' . $limitCount);


// Setting up content type and charset headers 
header('Content-Type: '.feed_content_type('rss-http').';charset='.get_option('blog_charset'), true);

// Setting up valid XML encoding
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
?> 

<!-- Declaring XML Validators namespaces -->
<rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
        <?php do_action('rss2_ns'); ?>>
<!-- Declaring channel with articles data --> 
<?php $dateTimeFormat = 'D, M d Y H:i:s'; ?>
<channel>
        <title><?php bloginfo_rss('name'); ?> - Feed</title>
        <link><?php bloginfo_rss('url') ?></link>
        <description><?php bloginfo_rss('description') ?></description>
        <lastBuildDate><?php echo mysql2date($dateTimeFormat, 

Open in new window

0
i'm trying to group/con-cat multiple rows into one, but not able to achieve the result which i want.

Below is the query which im using:
select  h.sVoucherNo,
 hd.Product_ID_Pattern_ID,
 fabstuc=(SELECT stuff((select ',' + (ep.sName) + ','  
 where ep.iMasterId=i.iProduct
  FOR XML PATH ('')),1,1,''))
      from tCore_Header_0 h
inner join tCore_Data_0 d on d.iHeaderId=h.iHeaderId
inner join tCore_Indta_0 i on i.iBodyId=d.iBodyId
inner join mCore_Product ep on i.iProduct=Ep.iMasterId
inner join tCore_HeaderData5637_0 hd on hd.iHeaderId=h.iHeaderId
where h.iVoucherType in (5637) and h.sVoucherNo in (2,9)

Open in new window

i have attached the query result.
Capture.JPG
0
Hi
i have a problem in xml parocessing in java using dom,it is my sample xml file
<titleGroup>

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

</titleGroup>

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);
            
            if(node1.getNodeName().equals("title"))
            {
                Element e=(Element)node1;
            if(e.getAttribute("type").equals("main"))
            {
                String s=e.getTextContent();
                 al.add(s);//Read content from main section
                
            }
           if(e.getAttribute("type").equals("tocForm"))
            {
             String s=e.getTextContent();
             al1.add(s);//read content from TocFrom section
             }
            }
            if(al.containsAll(al1))
            {//do  something
            
        }

Open in new window

0
I wrote code to pass an XML parameter in ADO from Access 2003 VBA to SQL Server 2012 but get the error message  "Parameter object is improperly defined.  Inconsistent or incomplete information was provided." on the line of code that appends the parameter to the parameters collection.  I'm using the "MSOLEDBSQL" data access provider for the first time because I read that is supports XML.  Note: I'm also using the DataTypeCompatibility=80 keyword in the connection string, which I read has to be used for XML support.  I also believe I am passing well formed xml.  What am I doing wrong?  Here is the code and the xml ...

    Dim cn As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim param1 As New ADODB.Parameter
       
    cn.ConnectionString = "Provider=MSOLEDBSQL;" _
             & "Server=ALTEKDC2;" _
             & "Database=ALTEK;" _
             & "UID=user1;" _
             & "PWD=xyz;" _
             & "DataTypeCompatibility=80;"
'             & "MARS Connection=True;"     For Multiple Result Sets
    cn.Open
    'cn.Open Forms!DummyForm!tbxOLEConnectString
    With cmd
        .ActiveConnection = cn
        .CommandText = "procCheckConditions"
        .CommandType = adCmdStoredProc
        Set param1 = .CreateParameter("ProgramFunctionId", adInteger, adParamInput, , lngProgramFunctionId)
        .Parameters.Append param1
        MsgBox strXML
        Set param1 = .CreateParameter("XML", adLongVarChar, adParamInput, , strXML)
        …
0
I am making an xml call in a web page to a url to retrieve address information from longitude and latitude coordinates.
     http://api.geonames.org/findNearestAddress?lat=42.643&lng=-71.314&username=xyz
I get the results as:

<?xml version="1.0" encoding="UTF-8"?>
  -<geonames>
    -<address>
      <street>Dutton St</street>
      <placename>Lowell</placename>
      <adminCode1>MA</adminCode1>
   </address>
  </geonames>

How do I parse out the results to display as street, place name1, AdminCode1
This is my code.  It retrieves fine, but I'm only able to display the entire results string as value.

<%
On Error Resume Next  ' prevent tossing unhandled exception
Dim URL, objXML, value, ElemStreet, ElemTown, ElemState
URL = "http://api.geonames.org/findNearestAddress?lat="&(rsEquipment.Fields.Item("JDLink_Latitude").Value)&"&lng="&(rsEquipment.Fields.Item("JDLink_Longitude").Value)&"&username=xyz"
Set objXML = Server.CreateObject("MSXML2.DOMDocument.6.0")
value = objXML.documentElement.Text

set ElemStreet = objXML.getElementsByTagName("street")
set ElemTown = objXML.getElementsByTagName("placename")
set ElemState= objXML.getElementsByTagName("adminCode1")

set objXML = nothing
%>

and I attempt to write the results as
<%= ElemStreet %><%= ElemTown %><%= ElemState %>

Basically, I'm attempting to break out the Street City and State from the value
0
The Server 2016 Active Directory domain within my organization is currently using a custom start layout XML file to control which programs are pinned to the taskbar on Windows 10 client computers.

This is being done using the steps described here.

While we want the icons that are pinned by this group policy custom XML file to stay pinned, we would also like the users to be able to pin other icons to their taskbars as well. Not all users within our organization use the same programs and certain users want certain programs or apps pinned while other users don't, etc. so we would like individual users to be able to choose which additional icons (if any) will be pinned and for their computers to retain these customizations that they make.

However, we have found that using the current configuration this isn't possible.

So are there any ways of changing this so that users will be able to customize which other icons they want to have pinned to their Windows 10 taskbars?
0
Please help me with the sql . this is the sql to convert to xml . I need to get the tc.termID field values which is multiple for one course . I need to show this in xml like this
<course>
<term></terms>
<term synckey="TermID1"/>
<term synckey="TermID2"/>
... ..it goes on
</course>

SELECT DISTINCT  CONVERT(VARCHAR(10),tc.courseID) +'_'+ t.staffNumber  AS [sourcedid/id]
                              ,tc.courseName + '-'+t.lastname                                                AS [description/short]
                              ,CONVERT(VARCHAR(10),t.schoolid)                         AS [relationship/sourcedid/id]
                              ,'COURSE'                                                                              AS [grouptype/typevalue]
                              ,''                                                         AS [timeframe/begin]
                              ,''                                                         AS [timeframe/end]
                              ,'FROMTEMPLATE'                                                                        AS [grouptype/scheme]
                              ,tc.[templateID]                                                                  AS [extension/course/coursetemplate/coursetemplatesynckey]
                              ,'X-CourseCreator'                                                                  AS [extension/course/coursetemplate/coursecreatorsynckey]
                              ,tc.termID as [extension/course/terms/termsynckey]
                              
                  FROM dbo.teacher t
                  JOIN dbo.tcourse tc
                        on  t.sectionID = tc.sectionID
                        and t.personID = tc.teacherId  
                  join school sct
                        on tc.schoolID = sct.schoolid
                        
                  WHERE tc.category = 'Curriculum'
                  
                  
                  FOR XML PATH ('group'), ROOT ('enterprise')
0
Recently received assistance with VBScript to merge XML documents from a folder into a single, new XML document.

The critical element in that discussion was that I needed to add an element to each node in the new XML document which contains the name of the file that the original node was found in.  Now I have found that occasionally, the original XML file might contain more than one node (order).  But I've found that in these instances, although all of the nodes from the original file are present in the new XML file, only one of them contains the new "FileName" element.

My modifications to Bill Prew's code look like:

Public Sub MergeOrders()
	Dim oFileSys
	Dim oFolder
	Dim aFiles
	Dim file
	Dim xmlPath1
	Dim xmlPath2
	Dim xmldoc1: Set xmldoc1 = CreateObject("MSXML2.DomDocument")
	Dim xmldoc2: Set xmldoc2 = CreateObject("MSXML2.DomDocument")
	Dim Orders
	Dim Order
	Dim NodeToRemove
	Dim strZeroLenFiles
	Dim NodeFileName
	Dim node
	Dim D2 
	
	Set NodeToRemove = xmldoc1.selectNodes("/OperatorName/FileName")
	
	Set oFileSys = WScript.CreateObject("Scripting.FileSystemObject")
	Set oFolder = oFileSys.GetFolder(ftpLocalDir)
	Set aFiles = oFolder.Files
	strZeroLenFiles = ""
	
	For Each file In aFiles

		If file.size = 0 then
		
			if strzerolenfiles <> "" then strZeroLenFiles = strZeroLenFiles & vbCrLf
			strZeroLenFiles = strZeroLenFiles & File.Name
			
		Else 
	
			If

Open in new window

0
Cloud Class® Course: Ruby Fundamentals
LVL 12
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

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 @xml NVARCHAR(MAX)
DECLARE @body NVARCHAR(MAX)
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'
FROM  
vw_Porivder_GenbaWalk_Activity_PM_SS_6_18_18
Where Created > '2018-4-1'
and email = 'ana@aol.com'
order by created desc







FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))



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!'
+

'</H3>
<table border = 1>
<tr>
<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 …
0
I had this question after viewing Python ElementTree xml output to csv.

I am attempting to use the same xml.etree solution but I am having a bit of trouble. I don't fully understand how to .find, .findall, and .iter in order to access the nodes and attributes. This is my test code that I ran on a nested xml file (attached) . writing out the row with the rowheaders works fine - that's why it's commented out.

I just ran a new test that worked but it's not very elegant. However, I have all the columns of my csv file. I read in the file as a string because I'm working from a web-based interpreter at home right now. I think I'll try lmxl to see if I can utilize xpath syntax to tighten up the code.

file = sys.stdin.read()
root = ET.fromstring(file)

#!  Python3

"""
Program uses xml.etree module to select data elements from the xml tree, names
 row headers, and  csv.writer then writes them to a csv file. Rows are appended
 to the file as each file in the directory  is processed.,

Program Author:            Gerald I Cheves
Date written:            25 June 2018
Last Revision:            25 June 2018
"""

import xml.etree.ElementTree as ET
import csv
import winsound

tree = ET.parse('C:\\Users\\GCheves\\aladin\\Test-Files\\Person.xml')
root = tree.getroot()

"""
with open('C:\\Users\\GCheves\\aladin\\Output\\xml-csv-output.csv', 'w') as fout:
    writer = csv.writer(fout, …
0
I am having a hard time creating a site map with https://www.gopherstateevents.com/  Could it be because I have several pages (including the home page) that were made with Mobirise and the rest are classic asp pages?  I've tried several online xml site map creators and none seem to be working for me.
0
I'm trying to read an xml response from a api but I keep getting the following error:


How can I read the xml data if the response looks like this:
<status>success</status><statusmsg>online</statusmsg><vmstat>online</vmstat><hostname>quantum.vps</hostname><ipaddress>xxx.xx.xx.xxx</ipaddress>

Open in new window


My current code:
procedure TfrmMain.btn1Click(Sender: TObject);
var
  httpclient: TIdHTTP;
  doc: TXMLDocument;
  data: IXMLNode;
begin
  httpclient := TIdHTTP.Create(nil);
  try
    doc := TXMLDocument.Create(nil);
    try
      doc.XML.Text := httpclient.Get('https://site.com/api.php?action=status'); //Modified URL for experts exchange
      doc.Active := True;
      data := doc.DocumentElement;
      lbl1.Text := data.ChildNodes['status'].Text;
    finally
      doc.Free;
    end;
  finally
    httpclient.Free;
  end;
end;

Open in new window

0
Currently working on an app in A with 3 pages (activities if you will).

A login, register & reservation page. All work fine except for the latter. Whenever i try sending data to my local database, on the reservation page I get an error. The error's inside my succes/fail message after i've pressed the send button

How do i fix this ?



Reservation.JAVA (called Reserveer.JAVA)

 
package com.example.baudelo.zeilreservering;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class Reserveer extends AppCompatActivity {
    EditText Eindereservering;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_boten);
        Eindereservering = (EditText)findViewById(R.id.dteDatum);
    }

public void OnRes(View view) {
    String dte_datum = Eindereservering.getText().toString();
    String type = "reserveer";
    BackgroundWorker backgroundWorker = new BackgroundWorker(this);
    backgroundWorker.execute(type, dte_datum);
}

}

Open in new window

BackgroundWorker.JAVA

package com.example.baudelo.zeilreservering;

import android.app.AlertDialog;
import android.content.Context;
import android.os.AsyncTask;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import 

Open in new window

0
I have tried so many different ways to get this to work and it just keeps loading the first item. I need to be able to populate various text boxes with all the items from the XML file once the text is matched from the combobox.

Basically, I load my app, I FIRST read the XML file to load the ComboBox, then when I select an item from the ComboBox, I load other text boxes with the details of an error.

XML:
<?xml version="1.0" encoding="us-ascii"?>
<!--SIP Data created by TECH on 1/24/2014 10:07:04 AM-->
<ERROR_ITEMS>
    <ERROR_DATA Posted="6/11/2018 12:00:00 PM">
        <Response>ERROR001</Response>
            <Method>ErrorCode001</Method>
                <Request>Acknowledged</Request>
                    <Code>001</Code>
                        <Information>Information for code 001 goes here</Information>
                            <Troubleshooting>Error 001 designates connections failed. Check all connections.</Troubleshooting>
                                <Additional_Notes>Tech notes: Ensure proper gauge of wiring.</Additional_Notes>
                                    <DateTimeSaved>11/10/2014 1:45:25 PM</DateTimeSaved>
        <Response>ERROR002</Response>
            <Method>ErrorCode002</Method>
                <Request>Acknowledged</Request>
                    <Code>002</Code>
                        <Information>Information for code 002 goes here</Information>
                            <Troubleshooting>Error 002 designates input 

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