powered by simpleCommunicator - 2.0.49     © 2025 Programmizd 02
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / Помогите с xsl
2 сообщений из 2, страница 1 из 1
Помогите с xsl
    #38889840
Добрый день, есть файл xml:
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
<?xml version="1.0" encoding="UTF-8"?>
<nonpublicExecutionReport xmlns:nsdext="http://www.fpml.org/FpML-5/recordkeeping/nsd-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" fpmlVersion="5-4" xsi:schemaLocation="http://www.fpml.org/FpML-5/recordkeeping fpml-recordkeeping-merged-schema.xsd http://www.fpml.org/FpML-5/recordkeeping/nsd-ext nsd-ext-merged-schema.xsd" xmlns="http://www.fpml.org/FpML-5/recordkeeping">
  <header>
    <messageId messageIdScheme="http://repository.nsd.ru/coding-scheme/messageid(nsdrus)">82</messageId>
    <sentBy>RP0023000001</sentBy>
    <sendTo>NDC000000000</sendTo>
    <creationTimestamp>2015-02-19T12:26:33</creationTimestamp>
    <implementationSpecification>
      <version>3.4</version>
    </implementationSpecification>
  </header>
 
</nonpublicExecutionReport>


Пытаюсь с него считать с помощью файл xls
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
    <h1>Music Collection:</h1>
    <table border="2">
      <tr bgcolor="#9acd37">
        <th>MessageID</th>
        <th>sentBy</th>
      </tr>
      <tr>
        <td><xsl:value-of select="nonpublicExecutionReport/header/messageId" /></td>
        <td><xsl:value-of select="nonpublicExecutionReport/header/sentBy" /></td>
      </tr>
    </table> 
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>


И ничего не получется
При чем такой xml:

Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
<?xml version="1.0" encoding="UTF-8"?>
  <header>
    <messageId messageIdScheme="http://repository.nsd.ru/coding-scheme/messageid(nsdrus)">82</messageId>
    <sentBy>RP0023000001</sentBy>
    <sendTo>NDC000000000</sendTo>
    <creationTimestamp>2015-02-19T12:26:33</creationTimestamp>
    <implementationSpecification>
      <version>3.4</version>
    </implementationSpecification>
  </header>
 


c помощью такого xsl
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
    <h1>Music Collection:</h1>
    <table border="2">
      <tr bgcolor="#9acd37">
        <th>MessageID</th>
        <th>sentBy</th>
      </tr>
      <tr>
        <td><xsl:value-of select="header/messageId" /></td>
        <td><xsl:value-of select="header/sentBy" /></td>
      </tr>
    </table> 
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>

Читается нормально. Где грабли?
...
Рейтинг: 0 / 0
Помогите с xsl
    #38889846
Фотография _Vasilisk_
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Новопашин ВладимирГде грабли?Здесь
Новопашин Владимир
Код: xml
1.
xmlns="http://www.fpml.org/FpML-5/recordkeeping"


Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:rk="http://www.fpml.org/FpML-5/recordkeeping">

<xsl:template match="/">
  <html>
  <body>
    <h1>Music Collection:</h1>
    <table border="2">
      <tr bgcolor="#9acd37">
        <th>MessageID</th>
        <th>sentBy</th>
      </tr>
      <tr>
        <td><xsl:value-of select="rk:nonpublicExecutionReport/rk:header/rk:messageId" /></td>
        <td><xsl:value-of select="rk:nonpublicExecutionReport/rk:header/rk:sentBy" /></td>
      </tr>
    </table> 
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / Помогите с xsl
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]