Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: prosze o pomoc z tabela w xml
Forum PHP.pl > Forum > XML, AJAX
robsonnn
witam jestem nowy na forum wiec proszę od razu nie banować itp ... otóż potrzebuje pomocy przy takim zadaniu :

Przedstawić obsługę bazy XML w oknie przeglądarki
internetowej. Minimalne wymagania: wyświetlanie
rekordów, zalecane: przeglądanie do przodu i do tyłu


z xml jestem zielony udało mi się wygenerować z accesa taki kod :


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nowa.xsd" generated="2011-05-25T13:18:08">
  3. <?xml-stylesheet type="text/css" href="styl.css"?>
  4. <nowa>
  5. <Identyfikator>5</Identyfikator>
  6. <Pole1>imie</Pole1>
  7. <Pole2>nazwisko</Pole2>
  8. <Pole3>ocena</Pole3>
  9. <Pole4>num.id</Pole4>
  10. <Pole5>plec</Pole5>
  11. </nowa>
  12. <nowa>
  13. <Identyfikator>6</Identyfikator>
  14. <Pole1>aneta</Pole1>
  15. <Pole2>xxx</Pole2>
  16. <Pole3>3</Pole3>
  17. <Pole4>123</Pole4>
  18. <Pole5>k</Pole5>
  19. </nowa>
  20. <nowa>
  21. <Identyfikator>7</Identyfikator>
  22. <Pole1>ania</Pole1>
  23. <Pole2>xxx</Pole2>
  24. <Pole3>4</Pole3>
  25. <Pole4>124</Pole4>
  26. <Pole5>k</Pole5>
  27. </nowa>
  28. <nowa>
  29. <Identyfikator>8</Identyfikator>
  30. <Pole1>robert</Pole1>
  31. <Pole2>xxx</Pole2>
  32. <Pole3>5</Pole3>
  33. <Pole4>125</Pole4>
  34. <Pole5>m</Pole5>
  35. </nowa>
  36. <nowa>
  37. <Identyfikator>9</Identyfikator>
  38. <Pole1>wojtek</Pole1>
  39. <Pole2>xxx</Pole2>
  40. <Pole3>5</Pole3>
  41. <Pole4>126</Pole4>
  42. <Pole5>m</Pole5>
  43. </nowa>
  44. <nowa>
  45. <Identyfikator>10</Identyfikator>
  46. <Pole1>artur</Pole1>
  47. <Pole2>xxx</Pole2>
  48. <Pole3>4</Pole3>
  49. <Pole4>127</Pole4>
  50. <Pole5>m</Pole5>
  51. </nowa>
  52. <nowa>
  53. <Identyfikator>11</Identyfikator>
  54. <Pole1>pawel</Pole1>
  55. <Pole2>xxx</Pole2>
  56. <Pole3>3</Pole3>
  57. <Pole4>128</Pole4>
  58. <Pole5>m</Pole5>
  59. </nowa>
  60. <nowa>
  61. <Identyfikator>12</Identyfikator>
  62. <Pole1>marek</Pole1>
  63. <Pole2>xxx</Pole2>
  64. <Pole3>4</Pole3>
  65. <Pole4>128</Pole4>
  66. <Pole5>m</Pole5>
  67. </nowa>
  68. <nowa>
  69. <Identyfikator>13</Identyfikator>
  70. <Pole1>maciek</Pole1>
  71. <Pole2>xxx</Pole2>
  72. <Pole3>5</Pole3>
  73. <Pole4>132</Pole4>
  74. <Pole5>m</Pole5>
  75. </nowa>
  76. <nowa>
  77. <Identyfikator>14</Identyfikator>
  78. <Pole1>ola</Pole1>
  79. <Pole2>xxx</Pole2>
  80. <Pole3>3</Pole3>
  81. <Pole4>133</Pole4>
  82. <Pole5>k</Pole5>
  83. </nowa>
  84. <nowa>
  85. <Identyfikator>15</Identyfikator>
  86. <Pole1>asia</Pole1>
  87. <Pole2>xxx</Pole2>
  88. <Pole3>5</Pole3>
  89. <Pole4>134</Pole4>
  90. <Pole5>k</Pole5>
  91. </nowa>
  92. <nowa>
  93. <Identyfikator>16</Identyfikator>
  94. </nowa>
  95. </dataroot>



prosił bym o pomoc jak oprawić to w ramkę i sprawdzeniu z jakiego powodu wyskakuje mi błąd w przeglądarce jak otwieram ten plik
z góry dziękuje za pomoc
Zielony z xml
Ilware
użyj http://pl.php.net/manual/pl/book.simplexml.php klasa naprawdę banalna w użyciu, jak nie będziesz wiedział jak ją zastosować to napisz.

Co do błędu, nie wiem co jest mnie wyświetla poprawnie.Jaki masz błąd?W czym otwierasz?

p.s.

Możesz wywalić z pliku
  1. xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nowa.xsd" generated="2011-05-25T13:18:08"


raczej Ci nie potrzebne?
robsonnn
witam
po przeczytaniu paru poradników udało mi się uzyskać taki efekt :

to moj plik xml
  1. <?xml version="1.0"?>
  2. <?xml:stylesheet type="text/xsl" href="arkusik.xsl"?>
  3. <lista>
  4. <nowa>
  5. <Identyfikator>5</Identyfikator>
  6. <Pole1>imie</Pole1>
  7. <Pole2>nazwisko</Pole2>
  8. <Pole3>ocena</Pole3>
  9. <Pole4>num.id</Pole4>
  10. <Pole5>plec</Pole5>
  11. </nowa>
  12. <nowa>
  13. <Identyfikator>6</Identyfikator>
  14. <Pole1>aneta</Pole1>
  15. <Pole2>xxx</Pole2>
  16. <Pole3>3</Pole3>
  17. <Pole4>123</Pole4>
  18. <Pole5>k</Pole5>
  19. </nowa>
  20. <nowa>
  21. <Identyfikator>7</Identyfikator>
  22. <Pole1>ania</Pole1>
  23. <Pole2>xxx</Pole2>
  24. <Pole3>4</Pole3>
  25. <Pole4>124</Pole4>
  26. <Pole5>k</Pole5>
  27. </nowa>
  28. <nowa>
  29. <Identyfikator>8</Identyfikator>
  30. <Pole1>robert</Pole1>
  31. <Pole2>xxx</Pole2>
  32. <Pole3>5</Pole3>
  33. <Pole4>125</Pole4>
  34. <Pole5>m</Pole5>
  35. </nowa>
  36. <nowa>
  37. <Identyfikator>9</Identyfikator>
  38. <Pole1>wojtek</Pole1>
  39. <Pole2>xxx</Pole2>
  40. <Pole3>5</Pole3>
  41. <Pole4>126</Pole4>
  42. <Pole5>m</Pole5>
  43. </nowa>
  44. <nowa>
  45. <Identyfikator>10</Identyfikator>
  46. <Pole1>artur</Pole1>
  47. <Pole2>xxx</Pole2>
  48. <Pole3>4</Pole3>
  49. <Pole4>127</Pole4>
  50. <Pole5>m</Pole5>
  51. </nowa>
  52. <nowa>
  53. <Identyfikator>11</Identyfikator>
  54. <Pole1>pawel</Pole1>
  55. <Pole2>xxx</Pole2>
  56. <Pole3>3</Pole3>
  57. <Pole4>128</Pole4>
  58. <Pole5>m</Pole5>
  59. </nowa>
  60. <nowa>
  61. <Identyfikator>12</Identyfikator>
  62. <Pole1>marek</Pole1>
  63. <Pole2>xxx</Pole2>
  64. <Pole3>4</Pole3>
  65. <Pole4>128</Pole4>
  66. <Pole5>m</Pole5>
  67. </nowa>
  68. <nowa>
  69. <Identyfikator>13</Identyfikator>
  70. <Pole1>maciek</Pole1>
  71. <Pole2>xxx</Pole2>
  72. <Pole3>5</Pole3>
  73. <Pole4>132</Pole4>
  74. <Pole5>m</Pole5>
  75. </nowa>
  76. <nowa>
  77. <Identyfikator>14</Identyfikator>
  78. <Pole1>ola</Pole1>
  79. <Pole2>xxx</Pole2>
  80. <Pole3>3</Pole3>
  81. <Pole4>133</Pole4>
  82. <Pole5>k</Pole5>
  83. </nowa>
  84. <nowa>
  85. <Identyfikator>15</Identyfikator>
  86. <Pole1>asia</Pole1>
  87. <Pole2>xxx</Pole2>
  88. <Pole3>5</Pole3>
  89. <Pole4>134</Pole4>
  90. <Pole5>k</Pole5>
  91. </nowa>
  92. </lista>





a to plik xsl do niego

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3. <xsl:template match="/">
  4. <xsl:apply-templates />
  5. </xsl:template>
  6. <xsl:template match="lista">
  7. <h2><xsl:for-each select="*[0]"><xsl:node-name/></xsl:for-each> tabela</h2>
  8. <TABLE STYLE="border:5px solid black" BORDER="1">
  9. <TR STYLE="font-size:15pt; font-family:Verdana; font-weight:bold; text-decoration:underline">
  10. <TD STYLE="background-color:lightgrey"></TD>
  11. <xsl:for-each select="*[0]/*">
  12. <TD><xsl:node-name/></TD>
  13. </xsl:for-each>
  14. </TR>
  15. <xsl:for-each select="*">
  16. <TR STYLE="font-family:Verdana; font-size:13pt; padding:0px 6px">
  17. <TD STYLE="background-color:lightgrey">
  18. <xsl:value-of select="@id"/>
  19. </TD>
  20. <xsl:for-each select="*">
  21. <TD>
  22. <xsl:value-of select="."/>
  23. </TD>
  24. </xsl:for-each>
  25. </TR>
  26. </xsl:for-each>
  27. </TABLE>
  28. </xsl:template>
  29. </xsl:stylesheet>



z tabelka sobie poradziłem teraz tylko pozostaje problem jak wstawić w tabelkę fragment który będzie mi segregował dane od najmniejszej do największej questionmark.gif

juz sobie poradzilem temat do zamkniecia
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.