Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9303035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:23:29+00:00 2026-06-18T23:23:29+00:00

I actually work with XML file in PHP. I used simpleXML for my basic

  • 0

I actually work with XML file in PHP. I used simpleXML for my basic xml files. But now I have a different xml file and SimpleXML isnt enough good solution. From my xml I need to get from zbozi kod and počet . Have you any solutions?

<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://www.atcomp.cz/webservices">
  <xs:schema id="StavySkladu" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="StavySkladu" msdata:IsDataSet="true" msdata:Locale="cs-CZ">
      <xs:complexType>
        <xs:choice maxOccurs="unbounded">
          <xs:element name="Zbozi">
            <xs:complexType>
              <xs:attribute name="kod" type="xs:string" />
              <xs:attribute name="pocet" type="xs:int" />
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
  <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
    <StavySkladu xmlns="">
      <Zbozi diffgr:id="Zbozi1" msdata:rowOrder="0" kod="C5709A" pocet="0"/>
      <Zbozi diffgr:id="Zbozi2" msdata:rowOrder="1" kod="C5708A" pocet="0"/>
      <Zbozi diffgr:id="Zbozi3" msdata:rowOrder="2" kod="C5718A" pocet="45"/>
      <Zbozi diffgr:id="Zbozi4" msdata:rowOrder="3" kod="EC13S050088" pocet="2"/>
      <Zbozi diffgr:id="Zbozi5" msdata:rowOrder="4" kod="EC376123GB" pocet="3"/>
      <Zbozi diffgr:id="Zbozi6" msdata:rowOrder="5" kod="EC800302" pocet="0"/>
      <Zbozi diffgr:id="Zbozi7" msdata:rowOrder="6" kod="EC806392" pocet="2"/>
      <Zbozi diffgr:id="Zbozi8" msdata:rowOrder="7" kod="EC800202" pocet="1"/>
      <Zbozi diffgr:id="Zbozi9" msdata:rowOrder="8" kod="EC806872" pocet="1"/>
      <Zbozi diffgr:id="Zbozi10" msdata:rowOrder="9" kod="EPC163071" pocet="16"/>
      <Zbozi diffgr:id="Zbozi11" msdata:rowOrder="10" kod="EMD157021" pocet="0"/>
      <Zbozi diffgr:id="Zbozi12" msdata:rowOrder="11" kod="EPC834031" pocet="0"/>
      <Zbozi diffgr:id="Zbozi13" msdata:rowOrder="12" kod="EPC825341" pocet="17"/>
    </StavySkladu>
  </diffgr:diffgram>
</DataSet>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T23:23:30+00:00Added an answer on June 18, 2026 at 11:23 pm
    <?php
    $xml = new SimpleXMLElement($xmlstr);
    $xml->registerXPathNamespace('xs', 'http://www.w3.org/2001/XMLSchema');
    $path =' xs:schema/xs:element/xs:complexType/xs:choice/xs:element/xs:complexType/xs:attribute';
    
    foreach($xml->xpath($path) as $child)
    {
        $attributes = $child->attributes();
        echo "{$attributes['name']}\n";
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XML file (it's actually VS2010 dbproj file) <?xml version=1.0 enconding=utf-8?>
I'm trying to download an XML file, but it does not have a .xml
Like many variables in PHP using ini_set() on a page doesn't actually work. I've
I have a windows service that does some intensive work every one minute (actually
PLEASE NOTE, I have found a work around which actually works out better for
At work we are being asked to create XML files to pass data to
I'm trying to configure build.xml files for build forge, but it seems like I
i have that xml file : <?xml version=1.0 encoding=utf-8?> <reminders> <reminder> <Title>Alarm1</Title> <Description>Desc1</Description> <Time>03/07/2012
Hello I am having trouble with a xml file I am using. Now what
As a simple example, I have an xml file with a list of names

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.