|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
господа и дамы, помогите , пожалуйста. как это сделать. спасибо большое. ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 12:50 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
К каждому документу нужно написать XSL для его отображения ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 13:03 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
спасибо _Vasilisk_, создано: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="file:///F:/2/first.xsl"?> <first> <item> <sort>sort1</sort> <country>RU</country> <firm>qqqqq</firm> </item> <item> <sort>sort2</sort> <country>UA</country> <firm>123</firm> </item> <item> <sort>sort3</sort> <country>BY</country> <firm>dddd</firm> </item> <item> <sort>sort4</sort> <country>LT</country> <firm>ffff</firm> </item> </first> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:fo=" http://www.w3.org/1999/XSL/Format" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:fn=" http://www.w3.org/2005/xpath-functions"> <xsl:template match="first"> <html> <head> <title> Р’uilding materials </title> </head> <body> <table border="1" cellspacing="0" cellpadding="3"> <tr> <th>Sort</th> <th>Country</th> <th>Firm</th> </tr> <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="item"> <tr> <xsl:apply-templates /> </tr> </xsl:template> <xsl:template match="sort | country"> <td> <xsl:apply-templates /> </td> </xsl:template> <xsl:template match="firm"> <td> <a> <xsl:attribute name="href">second.xml?firm=<xsl:apply-templates/></xsl:attribute> <xsl:apply-templates/> </a> </td> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="file:///F:/2/second.xsl"?> <second> <item> <firm>qqqqq</firm> <inner>inner</inner> <price>12.12</price> </item> <item> <firm>123</firm> <inner>outer</inner> <price>66.12</price> </item> <item> <firm>dddd</firm> <inner>inner</inner> <price>15.12</price> </item> <item> <firm>ffff</firm> <inner>outer</inner> <price>56.12</price> </item> </second> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:fo=" http://www.w3.org/1999/XSL/Format" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:fn=" http://www.w3.org/2005/xpath-functions"> <xsl:variable name="varFirm"> <xsl:call-template name="show_detail"> <xsl:with-param name="firm" /> </xsl:call-template> </xsl:variable> <xsl:template name="show_detail" match="/"> <xsl:param name="firm" /> <xsl:for-each select="second/item"> <p>Firm: <xsl:value-of select="$firm" /></p> </xsl:for-each> </xsl:template> <xsl:template match="second"> <html> <head> <title> Р’uilding materials details </title> </head> <body> <table border="1" cellspacing="0" cellpadding="3"> <tr> <th>Firm</th> <th>Inner/Outer</th> <th>Price</th> </tr> <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="item"> <tr> <xsl:apply-templates /> </tr> </xsl:template> <xsl:template match="firm | inner | price"> <td> <xsl:apply-templates /> </td> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> непонятно как связать по ссылке. спасибо ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 13:06 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
пожалуйста выручайте программисты, плиз ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 14:32 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
tanship, В чем все-таки проблема? в 2х документах, сведении в таблицу, или в ссылке? Что в конечном итоге должно быть? Один html, два html? Если 2 html, почему второй html не html? Кто должен XML превращать в HTML, браузер или сервер? Ну, и ссылка, как запрос к серверу... браузер, (насколько я знаю - могу ошибаться), так не умеет... PS. Насчет 2-х документов, самый частый ответ - использовать функцию document() ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 15:15 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
refreg, дело в том, что в названии темы все условие задачи. как понимаю - должно быть два html. смущает что надо через ссылку. про сервер речи не идет. как понимаю все на стороне клиента. проблема в ссылке. ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 15:27 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
tanshipдело в том, что в названии темы все условие задачи. Это курсовая? XML даны? tanshipкак понимаю - должно быть два html.Почему второй html не является html? tanshipсмущает что надо через ссылку. про сервер речи не идет. как понимаю все на стороне клиента. проблема в ссылке.html обязательно формировать браузером, заранее наштамповать нужные нельзя? ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 15:45 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
refreg, это лаба дано: Строительные материалы: вид, страна, фирма / внутренние работы, наружные работы, каталог цен. то что сделано. first.xml <?xml version="1.0" encoding="UTF-8"?> <first> <item> <sort>sort1</sort> <country>RU</country> <firm>qqqqq</firm> </item> <item> <sort>sort2</sort> <country>UA</country> <firm>123</firm> </item> <item> <sort>sort3</sort> <country>BY</country> <firm>dddd</firm> </item> <item> <sort>sort4</sort> <country>LT</country> <firm>ffff</firm> </item> </first> second.xml <?xml version="1.0" encoding="UTF-8"?> <second> <item> <firm>qqqqq</firm> <inner>inner</inner> <price>12.12</price> </item> <item> <firm>123</firm> <inner>outer</inner> <price>66.12</price> </item> <item> <firm>dddd</firm> <inner>inner</inner> <price>15.12</price> </item> <item> <firm>ffff</firm> <inner>outer</inner> <price>56.12</price> </item> </second> надо срочно сделать, не понимаю, полная каша. не понимаю как связать по ссылке( ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 16:09 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
tanship, Как вариант, из второго xml сделать в html таблицу с якорями - и ссылки по якорям: Код: plaintext
... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 16:13 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
refreg, плиз поясни "Как вариант, из второго xml сделать в html таблицу с якорями - и ссылки по якорям:" сделано: first.xslt <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:fo=" http://www.w3.org/1999/XSL/Format" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:fn=" http://www.w3.org/2005/xpath-functions"> <xsl:template match="first"> <html> <head> <title> Вuilding materials </title> </head> <body> <table border="1" cellspacing="0" cellpadding="3"> <tr> <th>Sort</th> <th>Country</th> <th>Firm</th> </tr> <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="item"> <tr> <xsl:apply-templates /> </tr> </xsl:template> <xsl:template match="sort | country"> <td> <xsl:apply-templates /> </td> </xsl:template> <xsl:template match="firm"> <td> <a> <xsl:attribute name="href">second.xml#fr=<xsl:apply-templates/></xsl:attribute> <xsl:apply-templates/> </a> </td> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> и second.xlst <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:fo=" http://www.w3.org/1999/XSL/Format" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:fn=" http://www.w3.org/2005/xpath-functions"> <xsl:param name="fr"/> <xsl:template match="/"> <html> <head> <title>second</title> </head> <body> <a> <xsl:attribute name="href">first.xml</xsl:attribute> return to the first page </a> <table border="1"> <tr> <th>firm</th> <th>inner/outer</th> <th>price</th> </tr> <xsl:for-each select="second/item[firm=$fr]"> <tr> <td> <xsl:value-of select="firm"/> </td> <td> <xsl:value-of select="inner"/> </td> <td> <xsl:value-of select="price"/> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> не передает параметр, пожалуйста выручайте ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 16:21 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
tanship, Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.
PS. "fr=" не нужно - можно убрать в обоих xsl ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 16:39 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
Кстати, убрать ненужные можно скриптом, но это уже другая история другой форум. ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 16:43 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
refreg, спасибо большое, но не выходит не понимаю куда вставлять( ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 16:47 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
tanship, ну, это совсем плохо... <tr> <th>firm</th> <th>inner/outer</th> <th>price</th> </tr> <xsl:for-each select="second/item[firm=$fr]"> <tr> <td> <xsl:value-of select="firm"/> </td> <td> <xsl:value-of select="inner"/> </td> <td> <xsl:value-of select="price"/> </td> </tr> </xsl:for-each> </table> ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 16:52 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
refreg, подскажи что не так пожалуйста <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="first.xsl"?> <first> <item> <sort>sort1</sort> <country>RU</country> <firm>qqqqq</firm> </item> <item> <sort>sort2</sort> <country>UA</country> <firm>123</firm> </item> <item> <sort>sort3</sort> <country>BY</country> <firm>dddd</firm> </item> <item> <sort>sort4</sort> <country>LT</country> <firm>ffff</firm> </item> </first> .---- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:fo=" http://www.w3.org/1999/XSL/Format" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:fn=" http://www.w3.org/2005/xpath-functions"> <xsl:template match="first"> <html> <head> <title> Р’uilding materials </title> </head> <body> <table border="1" cellspacing="0" cellpadding="3"> <tr> <th>Sort</th> <th>Country</th> <th>Firm</th> </tr> <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="item"> <tr> <xsl:apply-templates /> </tr> </xsl:template> <xsl:template match="sort | country"> <td> <xsl:apply-templates /> </td> </xsl:template> <xsl:template match="firm"> <td> <a> <xsl:attribute name="href">second.xml#fr=<xsl:apply-templates/></xsl:attribute> <xsl:apply-templates/> </a> </td> </xsl:template> <xsl:template match="text()"> <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> ------- <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="second.xsl"?> <second> <item> <firm>qqqqq</firm> <inner>inner</inner> <price>12.12</price> </item> <item> <firm>123</firm> <inner>outer</inner> <price>66.12</price> </item> <item> <firm>dddd</firm> <inner>inner</inner> <price>15.12</price> </item> <item> <firm>ffff</firm> <inner>outer</inner> <price>56.12</price> </item> </second> ----- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" xmlns:fo=" http://www.w3.org/1999/XSL/Format" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:fn=" http://www.w3.org/2005/xpath-functions"> <xsl:param name="fr"/> <xsl:template match="/"> <html> <head> <title>second</title> </head> <body> <a> <xsl:attribute name="href">first.xml</xsl:attribute> return to the first page </a> <table border="1"> <tr> <th>firm</th> <th>inner/outer</th> <th>price</th> </tr> <xsl:for-each select="second/item"> <tr> <td> <a name="fr={firm/text()}"/> <xsl:value-of select="firm"/> </td> <td> <xsl:value-of select="inner"/> </td> <td> <xsl:value-of select="price"/> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> спасибо большон ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 17:01 |
|
2 XML-документа. Данные свести в таблицы. Документы соединяются при помощи ссылки.
|
|||
---|---|---|---|
#18+
refregВо второй html выводится все значения, просто позиционируется на нужном. Для визуального эффекта надо побольше строк.Или в чем-то другом проблема? ... |
|||
:
Нравится:
Не нравится:
|
|||
25.04.2011, 17:11 |
|
|
start [/forum/search_topic.php?author=faceta&author_mode=last_posts&do_search=1]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
get settings: |
11ms |
get forum list: |
13ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
35ms |
get topic data: |
8ms |
get forum data: |
3ms |
get page messages: |
50ms |
get tp. blocked users: |
1ms |
others: | 742ms |
total: | 894ms |
0 / 0 |