Bonjour à tous,
Une petite question concernant l'extraction d'une donnée d'un xml via XPATH.
Voici le xml :
Quel mon but ? Extraire les données qui se trouvent dans la balise <fo:block> ? J'arrive à retrouver une autre donnée mais ici, je coince un peu. J'arrive jusque <FreeText>. Comment aller plus loin ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115 <form xmlns:xformsx="http://xxx.inventivedesigners.com/xforms/extensions" xmlns:x9x_xfdataformatter="http://xxx.inventivedesigners.com/xforms/data-formatting" xmlns:idattxbc="http://xxx.inventivedesigners.com/xsl-fo/ext/attributes/bordercorner" xmlns:idprint="http://xxx.inventivedesigners.com/xsl-fo/ext/print-settings" xmlns:locale="java:java.util.Locale" xmlns:rename="http://xxx.inventivedesigners.com/xslt/rename-to-default-namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:chiba="http://chiba.sourceforge.net/xforms" xmlns:barcodeml="http://xxx.inventivedesigners.com/barcodeml/1.1" xmlns:exslt="http://exslt.org/common" xmlns:idattx="http://xxx.inventivedesigners.com/xsl-fo/ext/attributes" xmlns:st="http://xxx.inventivedesigners.com/xsl-fo/ext/styler" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:widget="http://xxx.inventivedesigners.com/x9x/widget" xmlns:move="http://xxx.inventivedesigners.com/xslt/element-move" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:idx="http://xxx.inventivedesigners.com/xsl-fo/ext/fo-elements" xmlns:x9x_alternative_dataformatter="http://xxx.inventivedesigners.com/xsl/ext/data-formatting" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:iddf="http://xxx.inventivedesigners.com/xforms/data-formatting" xmlns:x9x_dataformatter="java:com.id.saxon.extension.dataformatting.DataFormatter" xmlns:cs="http://xxx.inventivedesigners.com/services" xmlns:idcfg="http://xxx.inventivedesigners.com/x9x/configuration/xpath-extensions/"> <SuperHeader> <PrintInformation> <PrInfJobName>CentralPrintJob</PrInfJobName> <PrInfTimestamp>2017-03-21T11:42:32.570Z</PrInfTimestamp> <PrInfLogicalAddress>drukkerij</PrInfLogicalAddress> <PrInfArchive>false</PrInfArchive> <PrInfOutput>3</PrInfOutput> <PrInfCorrelationID>100005919530</PrInfCorrelationID> </PrintInformation> </SuperHeader> <Document> <Header> <Message> <MessageName>DI5</MessageName> <MessageNameDescription>Brief ter informatie</MessageNameDescription> <MessageOrder>0</MessageOrder> <MessageVersion>1</MessageVersion> <MessageLanguage>NL</MessageLanguage> <MessageID>049184409978</MessageID> <MessageOriginalDate>2017-03-21</MessageOriginalDate> <MessageOriginalName>DI5</MessageOriginalName> <MessageRegistered>false</MessageRegistered> <MessageDuplicate>false</MessageDuplicate> </Message> <Database> <MessageName>DI5</MessageName> <MessageLanguage>NL</MessageLanguage> <DestinationCountry>België</DestinationCountry> <DestinationINSS>9910198565</DestinationINSS> <ChildINSS/> <RefFileNumber>1492999</RefFileNumber> <OfficeCode>2</OfficeCode> <AgentNumber>00060843</AgentNumber> </Database> </Header> <RequestGeneral> <Office> <OfficeCode>2</OfficeCode> <OfficeName>P.B.</OfficeName> <OfficeStreet>Koning</OfficeStreet> <OfficeHouseNr>27</OfficeHouseNr> <OfficeZipcode>9000</OfficeZipcode> <OfficeCity>Gent</OfficeCity> <OfficePhone>09-244 99 99</OfficePhone> <OfficeFax>09-222 99 99</OfficeFax> <OfficeOpen>0900</OfficeOpen> <OfficeClosed>1630</OfficeClosed> <OfficeLanguage>NL</OfficeLanguage> </Office> <Agent> <AgentTitle>Mevrouw</AgentTitle> <AgentName>DE RYCKE</AgentName> <AgentFirstName>LILY</AgentFirstName> <AgentPhone>09-244 74 34</AgentPhone> <AgentNumber>00060843</AgentNumber> <AgentEmail>lily.derycke@famifed.be</AgentEmail> </Agent> <Destination> <DestinationTitleShort>Mevr</DestinationTitleShort> <DestinationTitleLong>Mevrouw</DestinationTitleLong> <DestinationName>Van Londe</DestinationName> <DestinationFirstName>Tan</DestinationFirstName> <DestinationStreet>Moor</DestinationStreet> <DestinationHouseNr>44</DestinationHouseNr> <DestinationPostBox>11</DestinationPostBox> <DestinationZipCode>9500</DestinationZipCode> <DestinationCity>Aalst</DestinationCity> <DestinationCountry>België</DestinationCountry> <AddressableId>PERSON_9910198565</AddressableId> <DestinationINSS>9910198565</DestinationINSS> <DestinationEmail/> <DestinationToTheAttentionOfTitle/> <DestinationCorrespondenceLanguage>NL</DestinationCorrespondenceLanguage> </Destination> <Administrator> <Destination> <DestinationTitleShort>Dhr</DestinationTitleShort> <DestinationTitleLong>Mijnheer</DestinationTitleLong> <DestinationName>De</DestinationName> <DestinationFirstName>Piet</DestinationFirstName> <DestinationStreet>Gent</DestinationStreet> <DestinationHouseNr>99</DestinationHouseNr> <DestinationZipCode>9700</DestinationZipCode> <DestinationCity>Oudenaarde</DestinationCity> <DestinationCountry>België</DestinationCountry> <AddressableId>NPPR_100002938601</AddressableId> <DestinationINSS/> <DestinationEmail/> <DestinationToTheAttentionOfTitle/> <DestinationCorrespondenceLanguage>NL</DestinationCorrespondenceLanguage> </Destination> <Forward>false</Forward> </Administrator> <References> <RefFileNumber>1492999</RefFileNumber> <RefInternalRef>1492999</RefInternalRef> <RefExternalRef/> <RefSignature/> <RefSignatureFunction/> </References> </RequestGeneral> <Extended> <FreeText> <fo:block padding-after="0.7em"> <fo:inline font-weight="bold">Gelieve zo spoedig het bewijs te leveren dat u nog steeds een uitkering ontvangt van FOD Sociale Zekerheid. Wij vragen een kopie van het rekeninguittreksel met bewijs van de betaling over december 2016. Zonder het betaalbewijs is ons jaarlijks controleformulier niet geldig.</fo:inline> </fo:block> <fo:block padding-after="0.7em"> </fo:block> </FreeText> <Option1> <fo:block padding-after="0.7em">kinderbijslag</fo:block> </Option1> </Extended> </Document> </form>
Si vous avez des pistes, je suis preneur ? Un grand merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 SELECT od.document_barcode ,od.document_xml::xml ,xpath('/form/Document/Header/Message/MessageName', od.document_xml::xml) AS form ,xpath('/form/Document/Extended/FreeText', od.document_xml::xml) AS Freetext FROM outgoing_documents od WHERE od.document_template = 'DI5' ;
Partager