/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to xml/info/XPath.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
***********************************************************
 
2
************** XPath (patterns) ***************************
 
3
***********************************************************
 
4
�ᯮ������ � xslt ��� �롮� 㧫�� ��� ��ࠡ�⪨, �����樨 ��ப
 
5
����頥��� � १����, etc...
 
6
 
 
7
|       or                      ⨯� ���
 
8
!       not                     ⨯� ���栭��
 
9
.       self                    ⥪�騩 �������
 
10
..      paren                   த�⥫�᪨ �������
 
11
/       root                    ��୥��� ������� (if standalone)
 
12
/       child                   ���୨� ��������(1�� ���������)
 
13
*                               �� 㧫� (if standalone)
 
14
*       descendant              �� ��⮬��
 
15
//      descentant-or-self      .|*
 
16
        ancestor                �� ���� த�⥫�᪨� 㧫�
 
17
        ancestor-or-self        .|ancestor
 
18
        following
 
19
        following-sibling       -|-
 
20
        preceding
 
21
        preceding-sibling       -|-
 
22
        namespace               
 
23
@       attribute               ���ਡ�� ⥪�饣� 㧫�
 
24
 
 
25
"name"                          ���� � ����� ������
 
26
node()                          �� �� 㧫��
 
27
text()                          �� ⥪�⮢� 㧫�
 
28
comment()                       ���樠��� 㧫� ������ਥ�
 
29
processing-instriction()        ���� �ᯮ��塞�� ������
 
30
        
 
31
�।�����(䨫����)
 
32
------------------
 
33
��ࠢ� �� �����䨪��஢, ����� ���� �।�����:
 
34
author[1]                       ���� 㧥� � ⠪�� ������
 
35
author[$any$ FirstName="..."]   ����騩 ���� ���� ���㧥� � ⠪�� ������ �
 
36
                                ���祭���
 
37
author[$all$ FirstName="..."]   ����騥 㪠����� ���祭��, ��� ��� 㧫�� � 
 
38
                                㪠����� ������
 
39
author[FirstName="..."]         $any$
 
40
author[FirstName]               ����騥 㪠����� ���㧥�
 
41
 
 
42
�ਬ���
 
43
-------
 
44
author[@id=2]                   ���� � 㪠���� ���ਡ�⮬ ࠢ�� 2
 
45
book[$any$ author="Kain"]       �����, �।� ���஢ ������ Kain
 
46
book[$all$ author="Kain"]       �����, �� �� ���஢ ������ Kain
 
47
 
 
48
 
 
49
� ��
 
50
-----   
 
51
/DOCUMENT/CHAPTER/SECTION[position()=1]         �㤥� �������� ���� ࠧ����
 
52
                                                ��� ����, ⮣�� ��� 
 
53
(/DOCUMENT/CHAPTER/SECTION)[position()=1]       ���� �� ���浪� ࠧ��� � 
 
54
                                                ���㬥��
 
55
 
 
56
�� �ਬ���
 
57
-----------
 
58
����� ���� XML ���㬥��:
 
59
        <hell>
 
60
                <url>hell.jpg</url>
 
61
                <size width="40"/>
 
62
        </hell>
 
63
 
 
64
�� ����� ��ࠡ��뢠���� � ������� ᫥���饣� xsl(�. AVT):
 
65
        <xsl:template match="hell">
 
66
                <img src="{url}" width="{size/@width}"/>
 
67
        </xsl:template>
 
68
 
 
69
����� ���饭��, �᫨ ���� ��᪮�쪮 㧫�� � ����� � ⥬ �� ������, �
 
70
xmlns(XML Namespace)
 
71