|
|
|
XSLT преобразование
|
|||
|---|---|---|---|
|
#18+
Всем привет, Помогите, пожалуйста, в освоении XSLT на примере. Есть XML документ. <xs:element name='vars'> <xs:annotation> <xs:documentation> The variables that are used in document templates. </xs:documentation> <xs:documentation> <para>These variables are referenced from templates with prefix <literal>$SERNA</literal>, for example: variable <literal>xml</literal> is referenced as <literal>$SERNA_XML</literal>.</para> <para>User may define his own variables for his convenience. To define a <literal>$SERNA_<replaceable>XXX</replaceable></literal> variable add an element with the name <replaceable>XXX</replaceable> with any namespace prefix.</para> </xs:documentation> </xs:annotation> Нужно сгенерить следующий HTML код. *vars* -- The variables that are used in document templates. These variables are referenced from templates with prefix _$SERNA_ for example: variable <literal>xml</literal> is referenced as _$SERNA_XML_. User may define his own variables for his convenience. To define a _$SERNA_XXX_ variable add an element with the name _XXX with any namespace prefix. Пытаюсь вот так <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="http://www.w3.org/2001/XMLSchema"> <xsl:output method="html" encoding="windows-1250"/> <xsl:param name="maxprice" select="150"/> <xsl:template match="/"> <html><body bgcolor="white"> <xsl:apply-templates/> </body></html> </xsl:template> <xsl:template match="pe:element"> *<b><xsl:apply-templates select="@name"/></b>* -- <xsl:value-of select="pe:annotation"/> </xsl:template> </xsl:stylesheet> Не понятно как обработать теги <para> и <literal>. Помогите! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 29.05.2006, 11:13 |
|
||
|
XSLT преобразование
|
|||
|---|---|---|---|
|
#18+
а у вас исходный xml вообще-то не соответствует стандарту xml, имхо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 30.05.2006, 15:16 |
|
||
|
XSLT преобразование
|
|||
|---|---|---|---|
|
#18+
Да он там привел XML Schema своих документов чтоли... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 03.06.2006, 07:25 |
|
||
|
XSLT преобразование
|
|||
|---|---|---|---|
|
#18+
по ходу это "неочищенное" задание на разработку, или тест какой.. не уверен, что такая схема (с комментами) вообще распарсится ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.06.2006, 14:23 |
|
||
|
XSLT преобразование
|
|||
|---|---|---|---|
|
#18+
cooluserДа он там привел XML Schema своих документов чтоли... нет, не своих.. серновских - вон че гугель пишет =) Syntext Serna: Developer's GuideThese variables are referenced from templates with prefix $SERNA , for example: variable xml is referenced as $SERNA_XML . User may define his own variables ... www.syntext.com/products/serna/doc/developers_guide/ - 202k - Сохранено в кэше - Похожие страницы про нераспарсится слова беру обратно - несразу увидел закрывающий тег </parna> шаблон не форматированный попался =) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.06.2006, 14:40 |
|
||
|
|

start [/forum/topic.php?fid=14&msg=33774973&tid=1334768]: |
0ms |
get settings: |
6ms |
get forum list: |
10ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
135ms |
get topic data: |
6ms |
get forum data: |
1ms |
get page messages: |
26ms |
get tp. blocked users: |
1ms |
| others: | 203ms |
| total: | 392ms |

| 0 / 0 |
