Jump to content

XML neveras uz Excel


Baigais Janka
 Share

Recommended Posts

Tātad, zināmu iemeslu dēļ vajadzēs redigēt XML failu akurāt uz Excel 2010. Bet kauču kā kļūdu met. Nonivelēju līd galīgi prastam variantam - shēmas un xml faili šitādi:

<!-- a.xsd -->
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="item">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="text" type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="items">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="item"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
 
<!-- a.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="a.xsd">
  <item>
    <text>test item 1</text>
  </item>
  <item>
    <text>test item 2</text>
  </item>
</items>

Verot vaļā a.xml 'as an xml table', Excel brēc - "There is a problem with the specified xml or schema source". Kāds var pateikt, kur i feileris?

Labots - Baigais Janka
Link to comment
Share on other sites

piegdienā un vēl pirms trīsdiennieka līst forumā ar šitādām problēmēm?

Link to comment
Share on other sites

Baigais Janka

:) Taisni tāpēc - darbi jāpadara līdz loģiskam nobeigumam. Ta nu četrus darbus daru vienlaicīgi, un jā - jau pats redzu, ka šēma galīgi pakaļā :) - baisā tempā, par citām lietām domājot, rakstīju...



EDIT - tā, šēma nu ir pareiza, validējas utt., a Excel brēc, kā brēcis :(

Link to comment
Share on other sites

Bet ir taču tekstā redzams- avots atrodas http://.... u.t.t., ja pie tā netiek, gribot negribot ir jābrēc.

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

Only one top level element is allowed in an XML document. Error processing resource 'file:///C:/Documents and Settings/Alek...

<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="a.xsd">
-^

 

Un tas vēl labi, internets ir pieejams, varētu būt vēl sliktāk

Link to comment
Share on other sites

Baigais Janka

Jap, pareizi ir šitā:

<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="a.xsd">
...
Link to comment
Share on other sites

Izveido kontu, vai pieraksties esošajā, lai komentētu

Jums ir jābūt šī foruma biedram, lai varētu komentēt tēmas

Izveidot jaunu kontu

Piereģistrējies un izveido jaunu kontu, tas būs viegli!

Reģistrēt jaunu kontu

Pierakstīties

Jums jau ir konts? Pierakstieties tajā šeit!

Pierakstīties tagad!
 Share

×
×
  • Izveidot jaunu...