Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / Retrive data from XML / 3 сообщений из 3, страница 1 из 1
14.05.2008, 15:45
    #35312118
OLEG shlepchenko
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Retrive data from XML
Current XML have Stores number (RED) and Itemnumber(Blue) and describe items in stores:

<StoreData StoreCode="1">
<Line ItemPrice="65.85" UnitsQtyMea="1" ItemBarcode="x111" LineNo="1" UnitsQty="1.4" />
</StoreData>
<StoreData StoreCode="2">
<Line ItemPrice="171.49" UnitsQtyMea="1" ItemBarcode="x113" LineNo="2" UnitsQty="3.43" />
</StoreData>
<StoreData StoreCode="3">
<Line ItemPrice="15" UnitsQtyMea="1" ItemBarcode="x111" LineNo="3" UnitsQty="0.3" />
<Line ItemPrice="7.87" UnitsQtyMea="1" ItemBarcode="x112" LineNo="3" UnitsQty="0.31" />
</StoreData>


Required result to recieve stores for specific item "X111" :
<Line ItemPrice="15" UnitsQtyMea="1" ItemBarcode="x111" LineNo="3" UnitsQty="0.3" StoreCode=3 />
<Line ItemPrice="65.85" UnitsQtyMea="1" ItemBarcode="x111" LineNo="1" UnitsQty="1.4" StoreCode=1 />

Спасибо
...
Рейтинг: 0 / 0
14.05.2008, 17:20
    #35312537
Volder
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Retrive data from XML
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
	<xsl:template match="data">
		<data>
			<xsl:apply-templates select="StoreData"/>
		</data>
	</xsl:template>
	<xsl:template match="StoreData">
		<xsl:apply-templates select="Line[@ItemBarcode='x111']" mode="x111"/>
	</xsl:template>
	<xsl:template match="Line" mode="x111">
		<xsl:copy-of select="."/>
	</xsl:template>
</xsl:stylesheet>
...
Рейтинг: 0 / 0
14.05.2008, 17:33
    #35312569
Volder
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Retrive data from XML
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
	<xsl:template match="data">
		<data>
			<xsl:apply-templates select="StoreData"/>
		</data>
	</xsl:template>
	<xsl:template match="StoreData">
		<xsl:apply-templates select="Line[@ItemBarcode='x111']" mode="x111"/>
	</xsl:template>
	<xsl:template match="Line" mode="x111">
		<xsl:copy-of select="."/>
	</xsl:template>
</xsl:stylesheet>
...
Рейтинг: 0 / 0
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / Retrive data from XML / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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