Hex Artifact Content
Not logged in

Artifact 10379c7a117ca5ae09ba45608532b769da59c500:

Wiki page [ISO Metadata] by sandro 2013-03-18 12:08:36.
0000: 44 20 32 30 31 33 2d 30 33 2d 31 38 54 31 32 3a  D 2013-03-18T12:
0010: 30 38 3a 33 36 2e 37 36 34 0a 4c 20 49 53 4f 5c  08:36.764.L ISO\
0020: 73 4d 65 74 61 64 61 74 61 0a 55 20 73 61 6e 64  sMetadata.U sand
0030: 72 6f 0a 57 20 31 37 30 39 31 0a 62 61 63 6b 20  ro.W 17091.back 
0040: 74 6f 20 58 6d 6c 42 6c 6f 62 20 3c 61 20 68 72  to XmlBlob <a hr
0050: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e  ef="https://www.
0060: 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73  gaia-gis.it/foss
0070: 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 65  il/libspatialite
0080: 2f 77 69 6b 69 3f 6e 61 6d 65 3d 58 6d 6c 42 6c  /wiki?name=XmlBl
0090: 6f 62 2b 61 6e 64 2b 56 69 72 74 75 61 6c 58 50  ob+and+VirtualXP
00a0: 61 74 68 22 3e 6d 61 69 6e 20 70 61 67 65 3c 2f  ath">main page</
00b0: 61 3e 0d 0a 3c 68 32 3e 49 53 4f 20 4d 65 74 61  a>..<h2>ISO Meta
00c0: 64 61 74 61 20 2d 20 49 6e 74 72 6f 3c 2f 68 32  data - Intro</h2
00d0: 3e 0d 0a 53 74 61 72 74 69 6e 67 20 73 69 6e 63  >..Starting sinc
00e0: 65 20 76 65 72 73 69 6f 6e 20 3c 62 3e 34 2e 31  e version <b>4.1
00f0: 2e 30 3c 2f 62 3e 20 53 70 61 74 69 61 4c 69 74  .0</b> SpatiaLit
0100: 65 20 77 69 6c 6c 20 73 75 70 70 6f 72 74 20 3c  e will support <
0110: 62 3e 49 53 4f 20 4d 65 74 61 64 61 74 61 3c 2f  b>ISO Metadata</
0120: 62 3e 3b 20 61 6c 6c 20 6d 65 74 61 64 61 74 61  b>; all metadata
0130: 20 64 6f 63 75 6d 65 6e 74 73 20 65 78 61 63 74   documents exact
0140: 6c 79 20 61 72 65 20 58 4d 4c 20 44 6f 63 75 6d  ly are XML Docum
0150: 65 6e 74 73 2c 20 73 6f 20 74 68 65 20 77 68 6f  ents, so the who
0160: 6c 65 20 49 53 4f 20 4d 65 74 61 64 61 74 61 20  le ISO Metadata 
0170: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 73  implementation s
0180: 69 6d 70 6c 79 20 69 73 20 61 20 66 75 72 74 68  imply is a furth
0190: 65 72 20 73 70 65 63 69 61 6c 69 7a 65 64 20 65  er specialized e
01a0: 78 74 65 6e 73 69 6f 6e 20 62 61 73 65 64 20 6f  xtension based o
01b0: 6e 20 3c 62 3e 58 6d 6c 42 4c 4f 42 3c 2f 62 3e  n <b>XmlBLOB</b>
01c0: 2e 3c 62 72 3e 0d 0a 53 65 76 65 72 61 6c 20 64  .<br>..Several d
01d0: 69 66 66 65 72 65 6e 74 20 73 74 61 6e 64 61 72  ifferent standar
01e0: 64 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 73  d specifications
01f0: 20 61 72 65 20 63 6f 6c 6c 65 63 74 69 76 65 6c   are collectivel
0200: 79 20 67 72 6f 75 70 65 64 20 75 6e 64 65 72 20  y grouped under 
0210: 74 68 65 20 67 65 6e 65 72 69 63 20 6e 61 6d 65  the generic name
0220: 20 6f 66 20 3c 69 3e 49 53 4f 20 4d 65 74 61 64   of <i>ISO Metad
0230: 61 74 61 3c 2f 69 3e 3b 20 74 68 65 20 63 6f 6d  ata</i>; the com
0240: 6d 6f 6e 20 63 6f 72 65 20 72 65 66 65 72 65 6e  mon core referen
0250: 63 65 20 69 73 20 61 6c 77 61 79 73 20 62 61 73  ce is always bas
0260: 65 64 20 6f 6e 20 3c 61 20 68 72 65 66 3d 22 68  ed on <a href="h
0270: 74 74 70 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64  ttp://en.wikiped
0280: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 47 65 6f 73  ia.org/wiki/Geos
0290: 70 61 74 69 61 6c 5f 6d 65 74 61 64 61 74 61 22  patial_metadata"
02a0: 3e 49 53 4f 20 31 39 31 31 35 20 2f 20 31 39 31  >ISO 19115 / 191
02b0: 33 39 3c 2f 61 3e 2c 20 62 75 74 20 6d 61 6e 79  39</a>, but many
02c0: 20 66 75 72 74 68 65 72 20 73 70 65 63 69 61 6c   further special
02d0: 69 7a 65 64 20 65 78 74 65 6e 73 69 6f 6e 73 20  ized extensions 
02e0: 65 78 69 73 74 3a 20 6f 6e 65 20 6f 66 20 74 68  exist: one of th
02f0: 65 20 62 65 73 74 20 6b 6e 6f 77 6e 20 62 65 69  e best known bei
0300: 6e 67 20 65 2e 67 2e 20 74 68 65 20 3c 61 20 68  ng e.g. the <a h
0310: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 69 6e 73 70  ref="http://insp
0320: 69 72 65 2e 6a 72 63 2e 65 63 2e 65 75 72 6f 70  ire.jrc.ec.europ
0330: 61 2e 65 75 2f 22 3e 49 4e 53 50 49 52 45 3c 2f  a.eu/">INSPIRE</
0340: 61 3e 20 45 55 20 49 6e 69 74 69 61 74 69 76 65  a> EU Initiative
0350: 2e 0d 0a 3c 68 32 3e 44 42 20 54 61 62 6c 65 73  ...<h2>DB Tables
0360: 20 69 6d 70 6c 65 6d 65 6e 74 69 6e 67 20 49 53   implementing IS
0370: 4f 20 4d 65 74 61 64 61 74 61 3c 2f 68 32 3e 0d  O Metadata</h2>.
0380: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c  .<verbatim>..SEL
0390: 45 43 54 20 43 72 65 61 74 65 49 73 6f 4d 65 74  ECT CreateIsoMet
03a0: 61 64 61 74 61 54 61 62 6c 65 73 28 29 3b 0d 0a  adataTables();..
03b0: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65  </verbatim>..The
03c0: 20 3c 62 3e 43 72 65 61 74 65 49 73 6f 4d 65 74   <b>CreateIsoMet
03d0: 61 64 61 74 61 54 61 62 6c 65 73 28 29 3c 2f 62  adataTables()</b
03e0: 3e 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 77  > SQL function w
03f0: 69 6c 6c 20 61 74 74 65 6d 70 74 20 74 6f 20 63  ill attempt to c
0400: 72 65 61 74 65 20 61 6c 6c 20 44 42 20 54 61 62  reate all DB Tab
0410: 6c 65 73 20 72 65 71 75 69 72 65 64 20 69 6e 20  les required in 
0420: 6f 72 64 65 72 20 74 6f 20 65 6e 61 62 6c 65 20  order to enable 
0430: 49 53 4f 20 4d 65 74 61 64 61 74 61 20 73 75 70  ISO Metadata sup
0440: 70 6f 72 74 2e 3c 62 72 3e 0d 0a 41 6e 79 20 61  port.<br>..Any a
0450: 74 74 65 6d 70 74 20 74 6f 20 64 69 72 65 63 74  ttempt to direct
0460: 6c 79 20 63 72 65 61 74 65 20 6f 72 20 6f 74 68  ly create or oth
0470: 65 72 77 69 73 65 20 6d 61 6e 69 70 75 6c 61 74  erwise manipulat
0480: 65 20 74 68 65 73 65 20 54 61 62 6c 65 73 20 69  e these Tables i
0490: 73 20 73 74 72 6f 6e 67 6c 79 20 64 69 73 63 6f  s strongly disco
04a0: 75 72 61 67 65 64 3b 20 79 6f 75 20 61 72 65 20  uraged; you are 
04b0: 61 6c 77 61 79 73 20 65 78 70 65 63 74 65 64 20  always expected 
04c0: 74 6f 20 70 72 6f 70 65 72 6c 79 20 69 6e 76 6f  to properly invo
04d0: 6b 65 20 3c 62 3e 43 72 65 61 74 65 49 73 6f 4d  ke <b>CreateIsoM
04e0: 65 74 61 64 61 74 61 54 61 62 6c 65 73 28 29 3c  etadataTables()<
04f0: 2f 62 3e 2c 20 77 68 69 63 68 20 77 69 6c 6c 20  /b>, which will 
0500: 63 6f 72 72 65 63 74 6c 79 20 64 65 66 69 6e 65  correctly define
0510: 20 61 6c 6c 20 72 65 71 75 69 72 65 64 20 50 72   all required Pr
0520: 69 6d 61 72 79 20 2f 20 46 6f 72 65 69 67 6e 20  imary / Foreign 
0530: 4b 65 79 20 63 6f 6e 73 74 72 61 69 6e 74 73 2c  Key constraints,
0540: 20 61 73 20 77 69 6c 6c 20 63 72 65 61 74 65 20   as will create 
0550: 61 6c 6c 20 76 61 6c 69 64 61 74 69 6e 67 20 54  all validating T
0560: 72 69 67 67 65 72 73 20 65 78 70 65 63 74 65 64  riggers expected
0570: 20 74 6f 20 73 75 70 70 6f 72 74 20 74 68 65 73   to support thes
0580: 65 20 54 61 62 6c 65 73 2e 0d 0a 3c 76 65 72 62  e Tables...<verb
0590: 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 43 72  atim>..SELECT Cr
05a0: 65 61 74 65 49 73 6f 4d 65 74 61 64 61 74 61 54  eateIsoMetadataT
05b0: 61 62 6c 65 73 28 20 31 20 29 3b 0d 0a 3c 2f 76  ables( 1 );..</v
05c0: 65 72 62 61 74 69 6d 3e 0d 0a 3c 75 3e 50 6c 65  erbatim>..<u>Ple
05d0: 61 73 65 20 6e 6f 74 65 3c 2f 75 3e 3a 20 3c 62  ase note</u>: <b
05e0: 3e 43 72 65 61 74 65 49 73 6f 4d 65 74 61 64 61  >CreateIsoMetada
05f0: 74 61 54 61 62 6c 65 73 28 29 3c 2f 62 3e 20 77  taTables()</b> w
0600: 69 6c 6c 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 61  ill optionally a
0610: 63 63 65 70 74 20 61 20 73 69 6e 67 6c 65 20 28  ccept a single (
0620: 3c 69 3e 62 6f 6f 6c 65 61 6e 3c 2f 69 3e 29 20  <i>boolean</i>) 
0630: 61 72 67 75 6d 65 6e 74 20 69 6e 74 65 6e 64 65  argument intende
0640: 64 20 74 6f 20 63 68 6f 6f 73 65 20 62 65 74 77  d to choose betw
0650: 65 65 6e 20 3c 62 3e 73 74 72 69 63 74 3c 2f 62  een <b>strict</b
0660: 3e 20 61 6e 64 20 3c 62 3e 72 65 6c 61 78 65 64  > and <b>relaxed
0670: 3c 2f 62 3e 20 54 72 69 67 67 65 72 73 20 61 6c  </b> Triggers al
0680: 74 65 72 6e 61 74 69 76 65 20 69 6d 70 6c 65 6d  ternative implem
0690: 65 6e 74 61 74 69 6f 6e 73 3a 0d 0a 3c 75 6c 3e  entations:..<ul>
06a0: 0d 0a 3c 6c 69 3e 77 68 65 6e 20 3c 62 3e 73 74  ..<li>when <b>st
06b0: 72 69 63 74 20 6d 6f 64 65 3c 2f 62 3e 20 69 73  rict mode</b> is
06c0: 20 73 70 65 63 69 66 69 65 64 20 28 3c 75 3e 64   specified (<u>d
06d0: 65 66 61 75 6c 74 20 73 65 74 74 69 6e 67 3c 2f  efault setting</
06e0: 75 3e 29 20 61 6c 6c 20 4d 65 74 61 64 61 74 61  u>) all Metadata
06f0: 20 64 6f 63 75 6d 65 6e 74 73 20 61 72 65 20 65   documents are e
0700: 78 70 65 63 74 65 64 20 74 6f 20 73 75 63 63 65  xpected to succe
0710: 73 73 66 75 6c 6c 79 20 70 61 73 73 20 61 20 66  ssfully pass a f
0720: 6f 72 6d 61 6c 20 58 4d 4c 20 53 63 68 65 6d 61  ormal XML Schema
0730: 20 76 61 6c 69 64 61 74 69 6f 6e 2e 3c 62 72 3e   validation.<br>
0740: 0d 0a 49 66 20 66 6f 72 20 61 6e 79 20 72 65 61  ..If for any rea
0750: 73 6f 6e 20 73 75 63 68 20 53 63 68 65 6d 61 20  son such Schema 
0760: 76 61 6c 69 64 61 74 69 6f 6e 20 66 61 69 6c 73  validation fails
0770: 20 74 68 65 6e 20 74 68 65 20 54 72 69 67 67 65   then the Trigge
0780: 72 73 20 77 69 6c 6c 20 72 65 6a 65 63 74 20 61  rs will reject a
0790: 6e 79 20 61 74 74 65 6d 70 74 20 74 6f 20 69 6e  ny attempt to in
07a0: 73 65 72 74 20 74 68 65 20 6f 66 66 65 6e 64 69  sert the offendi
07b0: 6e 67 20 4d 65 74 61 64 61 74 61 20 64 6f 63 75  ng Metadata docu
07c0: 6d 65 6e 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  ment.</li>..<li>
07d0: 6f 6e 20 74 68 65 20 6f 74 68 65 72 20 73 69 64  on the other sid
07e0: 65 2c 20 77 68 65 6e 20 3c 62 3e 72 65 6c 61 78  e, when <b>relax
07f0: 65 64 20 6d 6f 64 65 3c 2f 62 3e 20 69 73 20 73  ed mode</b> is s
0800: 70 65 63 69 66 69 65 64 20 61 20 62 61 73 69 63  pecified a basic
0810: 20 63 68 65 63 6b 20 77 69 6c 6c 20 62 65 20 70   check will be p
0820: 65 72 66 6f 72 6d 65 64 20 73 6f 20 74 6f 20 65  erformed so to e
0830: 6e 73 75 72 65 20 74 68 61 74 20 74 68 65 20 53  nsure that the S
0840: 74 79 6c 69 6e 67 20 64 6f 63 75 6d 65 6e 74 20  tyling document 
0850: 69 73 20 3c 75 3e 77 65 6c 6c 2d 66 6f 72 6d 65  is <u>well-forme
0860: 64 3c 2f 75 3e 2c 20 62 75 74 20 6e 6f 20 58 4d  d</u>, but no XM
0870: 4c 20 53 63 68 65 6d 61 20 76 61 6c 69 64 61 74  L Schema validat
0880: 69 6f 6e 20 77 69 6c 6c 20 6e 65 76 65 72 20 62  ion will never b
0890: 65 20 65 76 61 6c 75 61 74 65 64 2e 3c 2f 6c 69  e evaluated.</li
08a0: 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c 74  >..</ul><br>..<t
08b0: 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25  able width="100%
08c0: 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 66 66 66  " bgcolor="#ffff
08d0: 63 63 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d  cc" cellpadding=
08e0: 22 34 22 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d  "4" cellspacing=
08f0: 22 31 30 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d  "10">..<tr><td>.
0900: 0a 3c 75 3e 3c 62 3e 49 6d 70 6f 72 74 61 6e 74  .<u><b>Important
0910: 20 6e 6f 74 69 63 65 3c 2f 62 3e 3c 2f 75 3e 3a   notice</b></u>:
0920: 20 6f 6c 64 65 73 74 20 76 65 72 73 69 6f 6e 73   oldest versions
0930: 20 6f 66 20 3c 62 3e 6c 69 62 78 6d 6c 32 3c 2f   of <b>libxml2</
0940: 62 3e 20 61 72 65 6e 27 74 20 61 62 6c 65 20 74  b> aren't able t
0950: 6f 20 73 75 70 70 6f 72 74 20 61 20 73 75 63 63  o support a succ
0960: 65 73 73 66 75 6c 20 53 63 68 65 6d 61 20 76 61  essful Schema va
0970: 6c 69 64 61 74 69 6f 6e 20 66 6f 72 20 3c 75 3e  lidation for <u>
0980: 49 53 4f 20 4d 65 74 61 64 61 74 61 3c 2f 75 3e  ISO Metadata</u>
0990: 20 64 6f 63 75 6d 65 6e 74 73 2e 0d 0a 55 73 69   documents...Usi
09a0: 6e 67 20 74 68 65 20 6d 6f 73 74 20 72 65 63 65  ng the most rece
09b0: 6e 74 20 3c 62 3e 32 2e 39 2e 30 3c 2f 62 3e 20  nt <b>2.9.0</b> 
09c0: 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 69 73 20  version of this 
09d0: 6c 69 62 72 61 72 79 20 73 65 65 6d 73 20 74 6f  library seems to
09e0: 20 62 65 20 61 6e 20 61 62 73 6f 6c 75 74 65 20   be an absolute 
09f0: 70 72 65 2d 72 65 71 75 69 73 69 74 65 2e 0d 0a  pre-requisite...
0a00: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 70 72  <ul>..<li>all pr
0a10: 65 2d 62 75 69 6c 74 20 62 69 6e 61 72 69 65 73  e-built binaries
0a20: 20 66 6f 72 20 57 69 6e 64 6f 77 73 20 72 65 6c   for Windows rel
0a30: 65 61 73 65 64 20 62 79 20 53 70 61 74 69 61 4c  eased by SpatiaL
0a40: 69 74 65 20 69 74 73 65 6c 66 20 73 75 72 65 6c  ite itself surel
0a50: 79 20 73 75 70 70 6f 72 74 20 3c 75 3e 6c 69 62  y support <u>lib
0a60: 78 6d 6c 32 20 32 2e 39 2e 30 3c 2f 75 3e 2c 20  xml2 2.9.0</u>, 
0a70: 61 6e 64 20 63 61 6e 20 62 65 20 74 68 75 73 20  and can be thus 
0a80: 73 61 66 65 6c 79 20 75 73 65 64 20 69 6e 20 3c  safely used in <
0a90: 75 3e 73 74 72 69 63 74 20 6d 6f 64 65 3c 2f 75  u>strict mode</u
0aa0: 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 77 68 69  >.</li>..<li>whi
0ab0: 6c 65 20 62 75 69 6c 64 69 6e 67 20 6f 6e 20 4c  le building on L
0ac0: 69 6e 75 78 20 69 74 27 73 20 76 65 72 79 20 70  inux it's very p
0ad0: 72 6f 62 61 62 6c 65 20 74 68 61 74 20 79 6f 75  robable that you
0ae0: 27 6c 6c 20 65 6e 63 6f 75 6e 74 65 72 20 61 20  'll encounter a 
0af0: 73 79 73 74 65 6d 20 70 72 65 2d 70 61 63 6b 61  system pre-packa
0b00: 67 65 64 20 3c 75 3e 6c 69 62 78 6d 6c 32 3c 2f  ged <u>libxml2</
0b10: 75 3e 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  u> corresponding
0b20: 20 74 6f 20 73 6f 6d 65 20 6f 62 73 6f 6c 65 74   to some obsolet
0b30: 65 20 76 65 72 73 69 6f 6e 3a 20 69 6e 20 74 68  e version: in th
0b40: 69 73 20 63 61 73 65 20 64 75 6c 79 20 73 77 69  is case duly swi
0b50: 74 63 68 69 6e 67 20 74 6f 20 3c 75 3e 72 65 6c  tching to <u>rel
0b60: 61 78 65 64 20 6d 6f 64 65 3c 2f 75 3e 20 69 73  axed mode</u> is
0b70: 20 73 74 72 6f 6e 67 6c 79 20 73 75 67 67 65 73   strongly sugges
0b80: 74 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e  ted.</li>..</ul>
0b90: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f  ..</td></tr>..</
0ba0: 74 61 62 6c 65 3e 0d 0a 3c 68 33 3e 74 68 65 20  table>..<h3>the 
0bb0: 49 53 4f 5f 6d 65 74 61 64 61 74 61 20 74 61 62  ISO_metadata tab
0bc0: 6c 65 3c 2f 68 33 3e 0d 0a 54 68 69 73 20 74 61  le</h3>..This ta
0bd0: 62 6c 65 20 69 73 20 73 70 65 63 69 66 69 63 61  ble is specifica
0be0: 6c 6c 79 20 69 6e 74 65 6e 64 65 64 20 74 6f 20  lly intended to 
0bf0: 73 74 6f 72 65 20 61 6c 6c 20 49 53 4f 20 4d 65  store all ISO Me
0c00: 74 61 64 61 74 61 20 64 6f 63 75 6d 65 6e 74 73  tadata documents
0c10: 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e  :..<ul>..<li><b>
0c20: 69 64 3c 2f 62 3e 20 73 69 6d 70 6c 79 20 69 73  id</b> simply is
0c30: 20 73 69 6d 70 6c 79 20 69 6e 74 65 6e 64 65 64   simply intended
0c40: 20 61 73 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20   as an internal 
0c50: 49 44 20 28 3c 75 3e 50 72 69 6d 61 72 79 20 4b  ID (<u>Primary K
0c60: 65 79 3c 2f 75 3e 29 3a 20 6e 6f 20 73 70 65 63  ey</u>): no spec
0c70: 69 61 6c 20 6d 65 61 6e 69 6e 67 20 69 73 20 61  ial meaning is a
0c80: 73 73 75 6d 65 64 20 6f 74 68 65 72 20 74 68 61  ssumed other tha
0c90: 6e 20 65 6e 73 75 72 69 6e 67 20 75 6e 69 71 75  n ensuring uniqu
0ca0: 65 6e 65 73 73 20 77 69 74 68 69 6e 20 74 68 65  eness within the
0cb0: 20 44 42 20 74 61 62 6c 65 2e 3c 2f 6c 69 3e 0d   DB table.</li>.
0cc0: 0a 3c 6c 69 3e 3c 62 3e 6d 64 5f 73 63 6f 70 65  .<li><b>md_scope
0cd0: 3c 2f 62 3e 20 73 70 65 63 69 66 69 65 73 20 74  </b> specifies t
0ce0: 68 65 20 69 6e 74 65 6e 64 65 64 20 73 63 6f 70  he intended scop
0cf0: 65 20 6f 66 20 65 61 63 68 20 4d 65 74 61 64 61  e of each Metada
0d00: 74 61 20 64 6f 63 75 6d 65 6e 74 3b 20 61 63 63  ta document; acc
0d10: 65 70 74 61 62 6c 65 20 76 61 6c 75 65 73 20 61  eptable values a
0d20: 72 65 3a 3c 62 72 3e 0d 0a 3c 69 3e 3c 62 3e 27  re:<br>..<i><b>'
0d30: 75 6e 64 65 66 69 6e 65 64 27 3c 2f 62 3e 3c 2f  undefined'</b></
0d40: 69 3e 2c 3c 69 3e 3c 62 3e 27 66 69 65 6c 64 53  i>,<i><b>'fieldS
0d50: 65 73 73 69 6f 6e 27 3c 2f 62 3e 3c 2f 69 3e 2c  ession'</b></i>,
0d60: 20 3c 69 3e 3c 62 3e 27 63 6f 6c 6c 65 63 74 69   <i><b>'collecti
0d70: 6f 6e 53 65 73 73 69 6f 6e 27 3c 2f 62 3e 3c 2f  onSession'</b></
0d80: 69 3e 2c 20 3c 69 3e 3c 62 3e 27 73 65 72 69 65  i>, <i><b>'serie
0d90: 73 27 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c  s'</b></i>, <i><
0da0: 62 3e 27 64 61 74 61 73 65 74 27 3c 2f 62 3e 3c  b>'dataset'</b><
0db0: 2f 69 3e 2c 20 3c 69 3e 3c 62 3e 27 66 65 61 74  /i>, <i><b>'feat
0dc0: 75 72 65 54 79 70 65 27 3c 2f 62 3e 3c 2f 69 3e  ureType'</b></i>
0dd0: 2c 20 3c 69 3e 3c 62 3e 27 66 65 61 74 75 72 65  , <i><b>'feature
0de0: 27 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c 62  '</b></i>, <i><b
0df0: 3e 27 61 74 74 72 69 62 75 74 65 54 79 70 65 27  >'attributeType'
0e00: 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c 62 3e  </b></i>, <i><b>
0e10: 27 61 74 74 72 69 62 75 74 65 27 3c 2f 62 3e 3c  'attribute'</b><
0e20: 2f 69 3e 2c 20 3c 69 3e 3c 62 3e 27 74 69 6c 65  /i>, <i><b>'tile
0e30: 27 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c 62  '</b></i>, <i><b
0e40: 3e 27 6d 6f 64 65 6c 27 3c 2f 62 3e 3c 2f 69 3e  >'model'</b></i>
0e50: 2c 20 3c 69 3e 3c 62 3e 27 63 61 74 61 6c 6f 67  , <i><b>'catalog
0e60: 75 65 27 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e  ue'</b></i>, <i>
0e70: 3c 62 3e 27 73 63 68 65 6d 61 27 3c 2f 62 3e 3c  <b>'schema'</b><
0e80: 2f 69 3e 2c 20 3c 69 3e 3c 62 3e 27 74 61 78 6f  /i>, <i><b>'taxo
0e90: 6e 6f 6d 79 27 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c  nomy'</b></i>, <
0ea0: 69 3e 3c 62 3e 27 73 6f 66 74 77 61 72 65 27 3c  i><b>'software'<
0eb0: 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c 62 3e 27  /b></i>, <i><b>'
0ec0: 73 65 72 76 69 63 65 27 3c 2f 62 3e 3c 2f 69 3e  service'</b></i>
0ed0: 2c 20 3c 69 3e 3c 62 3e 27 63 6f 6c 6c 65 63 74  , <i><b>'collect
0ee0: 69 6f 6e 48 61 72 64 77 61 72 65 27 3c 2f 62 3e  ionHardware'</b>
0ef0: 3c 2f 69 3e 2c 20 3c 69 3e 3c 62 3e 27 6e 6f 6e  </i>, <i><b>'non
0f00: 47 65 6f 67 72 61 70 68 69 63 44 61 74 61 73 65  GeographicDatase
0f10: 74 27 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c  t'</b></i>, <i><
0f20: 62 3e 27 64 69 6d 65 6e 73 69 6f 6e 47 72 6f 75  b>'dimensionGrou
0f30: 70 27 3c 2f 62 3e 3c 2f 69 3e 3c 2f 6c 69 3e 0d  p'</b></i></li>.
0f40: 0a 3c 6c 69 3e 3c 62 3e 6d 65 74 61 64 61 74 61  .<li><b>metadata
0f50: 3c 2f 62 3e 20 69 73 20 74 68 65 20 63 6f 72 72  </b> is the corr
0f60: 65 73 70 6f 6e 64 69 6e 67 20 4d 65 74 61 64 61  esponding Metada
0f70: 74 61 20 64 6f 63 75 6d 65 6e 74 20 28 65 78 70  ta document (exp
0f80: 65 63 74 65 64 20 74 6f 20 62 65 20 61 20 76 61  ected to be a va
0f90: 6c 69 64 20 3c 62 3e 58 6d 6c 42 4c 4f 42 3c 2f  lid <b>XmlBLOB</
0fa0: 62 3e 20 6f 66 20 74 68 65 20 49 53 4f 20 4d 65  b> of the ISO Me
0fb0: 74 61 64 61 74 61 20 74 79 70 65 29 2e 3c 2f 6c  tadata type).</l
0fc0: 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 66 69 6c 65 49  i>..<li><b>fileI
0fd0: 64 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 70 61 72  d</b> and <b>par
0fe0: 65 6e 74 49 64 3c 2f 62 3e 20 72 65 73 70 65 63  entId</b> respec
0ff0: 74 69 76 65 6c 79 20 63 6f 72 72 65 73 70 6f 6e  tively correspon
1000: 64 20 74 6f 20 74 68 65 20 76 61 6c 75 65 73 20  d to the values 
1010: 6f 66 20 74 68 65 20 3c 62 3e 26 6c 74 3b 67 6d  of the <b>&lt;gm
1020: 64 3a 66 69 6c 65 49 64 65 6e 74 69 66 69 65 72  d:fileIdentifier
1030: 26 67 74 3b 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e  &gt;</b> and <b>
1040: 26 6c 74 3b 67 6d 64 3a 70 61 72 65 6e 74 49 64  &lt;gmd:parentId
1050: 65 6e 74 69 66 69 65 72 26 67 74 3b 3c 2f 62 3e  entifier&gt;</b>
1060: 20 74 61 67 73 20 69 6e 74 65 72 6e 61 6c 6c 79   tags internally
1070: 20 64 65 63 6c 61 72 65 64 20 62 79 20 74 68 65   declared by the
1080: 20 58 4d 4c 20 64 6f 63 75 6d 65 6e 74 20 69 74   XML document it
1090: 73 65 6c 66 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  self.</li>..<li>
10a0: 3c 62 3e 67 65 6f 6d 65 74 72 79 3c 2f 62 3e 20  <b>geometry</b> 
10b0: 69 73 20 61 20 3c 62 3e 4d 55 4c 54 49 50 4f 4c  is a <b>MULTIPOL
10c0: 59 47 4f 4e 3c 2f 62 3e 20 28 3c 75 3e 62 6f 75  YGON</b> (<u>bou
10d0: 6e 64 69 6e 67 20 62 6f 78 3c 2f 75 3e 29 20 61  nding box</u>) a
10e0: 6e 64 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74  nd corresponds t
10f0: 6f 20 74 68 65 20 3c 62 3e 26 6c 74 3b 67 6d 64  o the <b>&lt;gmd
1100: 3a 45 58 5f 47 65 6f 67 72 61 70 68 69 63 42 6f  :EX_GeographicBo
1110: 75 6e 64 69 6e 67 42 6f 78 26 67 74 3b 3c 2f 62  undingBox&gt;</b
1120: 3e 20 74 61 67 28 73 29 20 69 6e 74 65 72 6e 61  > tag(s) interna
1130: 6c 6c 79 20 64 65 63 6c 61 72 65 64 20 62 79 20  lly declared by 
1140: 74 68 65 20 58 4d 4c 20 64 6f 63 75 6d 65 6e 74  the XML document
1150: 20 69 74 73 65 6c 66 2e 3c 62 72 3e 0d 0a 3c 75   itself.<br>..<u
1160: 3e 50 6c 65 61 73 65 20 6e 6f 74 65 3c 2f 75 3e  >Please note</u>
1170: 3a 20 49 53 4f 20 4d 65 74 61 64 61 74 61 20 63  : ISO Metadata c
1180: 6f 6f 72 64 69 6e 61 74 65 73 20 61 72 65 20 61  oordinates are a
1190: 6c 77 61 79 73 20 65 78 70 65 63 74 65 64 20 74  lways expected t
11a0: 6f 20 62 65 20 65 78 70 72 65 73 73 65 64 20 61  o be expressed a
11b0: 73 20 3c 75 3e 6c 6f 6e 67 69 74 75 64 65 73 3c  s <u>longitudes<
11c0: 2f 75 3e 20 61 6e 64 20 3c 75 3e 6c 61 74 69 74  /u> and <u>latit
11d0: 75 64 65 73 3c 2f 75 3e 2c 20 73 6f 20 3c 62 3e  udes</u>, so <b>
11e0: 53 52 49 44 3d 34 33 32 36 20 3c 69 3e 57 47 53  SRID=4326 <i>WGS
11f0: 38 34 3c 2f 69 3e 3c 2f 62 3e 20 69 73 20 61 6c  84</i></b> is al
1200: 77 61 79 73 20 61 73 73 75 6d 65 64 2e 3c 2f 6c  ways assumed.</l
1210: 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 68 33 3e 74  i>..</ul>..<h3>t
1220: 68 65 20 49 53 4f 5f 6d 65 74 61 64 61 74 61 5f  he ISO_metadata_
1230: 72 65 66 65 72 65 6e 63 65 20 74 61 62 6c 65 3c  reference table<
1240: 2f 68 33 3e 0d 0a 54 68 69 73 20 74 61 62 6c 65  /h3>..This table
1250: 20 69 73 20 73 70 65 63 69 66 69 63 61 6c 6c 79   is specifically
1260: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 72 65 70   intended to rep
1270: 72 65 73 65 6e 74 20 61 6e 79 20 70 6f 73 73 69  resent any possi
1280: 62 6c 65 20 72 65 66 65 72 65 6e 63 65 20 6a 6f  ble reference jo
1290: 69 6e 69 6e 67 20 49 53 4f 20 4d 65 74 61 64 61  ining ISO Metada
12a0: 74 61 20 64 6f 63 75 6d 65 6e 74 73 20 61 6e 64  ta documents and
12b0: 20 67 65 6f 67 72 61 70 68 69 63 20 66 65 61 74   geographic feat
12c0: 75 72 65 73 20 73 74 6f 72 65 64 20 77 69 74 68  ures stored with
12d0: 69 6e 20 74 68 65 20 73 61 6d 65 20 44 42 20 28  in the same DB (
12e0: 3c 75 3e 6c 61 79 65 72 73 3c 2f 75 3e 2c 20 3c  <u>layers</u>, <
12f0: 75 3e 63 6f 76 65 72 61 67 65 73 3c 2f 75 3e 2c  u>coverages</u>,
1300: 20 3c 75 3e 66 65 61 74 75 72 65 73 3c 2f 75 3e   <u>features</u>
1310: 2c 20 3c 75 3e 74 69 6c 65 73 3c 2f 75 3e 20 61  , <u>tiles</u> a
1320: 6e 64 20 73 6f 20 6f 6e 29 3a 0d 0a 3c 75 6c 3e  nd so on):..<ul>
1330: 0d 0a 3c 6c 69 3e 3c 62 3e 72 65 66 65 72 65 6e  ..<li><b>referen
1340: 63 65 5f 73 63 6f 70 65 3c 2f 62 3e 20 73 70 65  ce_scope</b> spe
1350: 63 69 66 69 65 73 20 74 68 65 20 69 6e 74 65 6e  cifies the inten
1360: 64 65 64 20 73 63 6f 70 65 20 6f 66 20 65 61 63  ded scope of eac
1370: 68 20 72 65 66 65 72 65 6e 63 65 3b 20 61 63 63  h reference; acc
1380: 65 70 74 61 62 6c 65 20 76 61 6c 75 65 73 20 61  eptable values a
1390: 72 65 3a 3c 62 72 3e 0d 0a 3c 69 3e 3c 62 3e 27  re:<br>..<i><b>'
13a0: 74 61 62 6c 65 27 3c 2f 62 3e 3c 2f 69 3e 2c 3c  table'</b></i>,<
13b0: 69 3e 3c 62 3e 27 63 6f 6c 75 6d 6e 27 3c 2f 62  i><b>'column'</b
13c0: 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c 62 3e 27 72 6f  ></i>, <i><b>'ro
13d0: 77 27 3c 2f 62 3e 3c 2f 69 3e 2c 20 3c 69 3e 3c  w'</b></i>, <i><
13e0: 62 3e 27 72 6f 77 2f 63 6f 6c 27 3c 2f 62 3e 3c  b>'row/col'</b><
13f0: 2f 69 3e 3c 2f 6c 69 3e 20 0d 0a 3c 6c 69 3e 3c  /i></li> ..<li><
1400: 62 3e 74 61 62 6c 65 5f 6e 61 6d 65 3c 2f 62 3e  b>table_name</b>
1410: 20 69 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 20   is the name of 
1420: 73 6f 6d 65 20 44 42 20 74 61 62 6c 65 20 28 3c  some DB table (<
1430: 75 3e 6c 61 79 65 72 3c 2f 75 3e 20 6f 72 20 3c  u>layer</u> or <
1440: 75 3e 63 6f 76 65 72 61 67 65 3c 2f 75 3e 29 2e  u>coverage</u>).
1450: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 63 6f  </li>..<li><b>co
1460: 6c 75 6d 6e 5f 6e 61 6d 65 3c 2f 62 3e 20 69 73  lumn_name</b> is
1470: 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 73 6f 6d   the name of som
1480: 65 20 63 6f 6c 75 6d 6e 20 62 65 6c 6f 6e 67 69  e column belongi
1490: 6e 67 20 74 6f 20 74 68 65 20 73 61 6d 65 20 74  ng to the same t
14a0: 61 62 6c 65 20 28 65 2e 67 2e 20 3c 75 3e 67 65  able (e.g. <u>ge
14b0: 6f 6d 65 74 72 79 3c 2f 75 3e 29 2e 3c 2f 6c 69  ometry</u>).</li
14c0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 72 6f 77 5f 69 64  >..<li><b>row_id
14d0: 5f 76 61 6c 75 65 3c 2f 62 3e 20 63 6f 75 6c 64  _value</b> could
14e0: 20 65 76 65 6e 74 75 61 6c 6c 79 20 72 65 66 65   eventually refe
14f0: 72 65 6e 63 65 20 61 20 73 69 6e 67 6c 65 20 72  rence a single r
1500: 6f 77 20 69 6e 20 74 68 65 20 73 61 6d 65 20 74  ow in the same t
1510: 61 62 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  able.</li>..<li>
1520: 3c 62 3e 74 69 6d 65 73 74 61 6d 70 3c 62 3e 20  <b>timestamp<b> 
1530: 69 73 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 73  is intended to s
1540: 70 65 63 69 66 79 20 74 68 65 20 3c 75 3e 64 61  pecify the <u>da
1550: 74 61 2d 74 69 6d 65 3c 2f 75 3e 20 77 68 65 6e  ta-time</u> when
1560: 20 74 68 65 20 6c 61 74 65 73 74 20 63 68 61 6e   the latest chan
1570: 67 65 20 74 6f 20 74 68 65 20 72 65 66 65 72 65  ge to the refere
1580: 6e 63 65 20 6f 63 63 75 72 72 65 64 2e 3c 2f 6c  nce occurred.</l
1590: 69 3e 0d 0a 3c 6c 69 3e 62 6f 74 68 20 3c 62 3e  i>..<li>both <b>
15a0: 6d 64 5f 66 69 6c 65 5f 69 64 3c 2f 62 3e 20 61  md_file_id</b> a
15b0: 6e 64 20 3c 62 3e 6d 64 5f 70 61 72 65 6e 74 5f  nd <b>md_parent_
15c0: 69 64 3c 2f 62 3e 20 28 3c 75 3e 46 6f 72 65 69  id</b> (<u>Forei
15d0: 67 6e 20 4b 65 79 3c 2f 75 3e 29 20 61 72 65 20  gn Key</u>) are 
15e0: 69 6e 74 65 6e 64 65 64 20 74 6f 20 72 65 66 65  intended to refe
15f0: 72 65 6e 63 65 20 74 68 65 20 63 6f 72 72 65 73  rence the corres
1600: 70 6f 6e 64 69 6e 67 20 49 53 4f 20 4d 65 74 61  ponding ISO Meta
1610: 64 61 74 61 20 64 6f 63 75 6d 65 6e 74 73 20 73  data documents s
1620: 74 6f 72 65 64 20 77 69 74 68 69 6e 20 74 68 65  tored within the
1630: 20 3c 62 3e 49 53 4f 5f 6d 65 74 61 64 61 74 61   <b>ISO_metadata
1640: 3c 2f 62 3e 20 74 61 62 6c 65 2e 3c 62 72 3e 0d  </b> table.<br>.
1650: 0a 3c 75 3e 50 6c 65 61 73 65 20 6e 6f 74 65 20  .<u>Please note 
1660: 77 65 6c 6c 3c 2f 75 3e 3a 20 73 75 63 68 20 72  well</u>: such r
1670: 65 66 65 72 65 6e 63 65 73 20 61 72 65 20 66 75  eferences are fu
1680: 6c 6c 79 20 62 61 73 65 64 20 6f 6e 20 69 6e 74  lly based on int
1690: 65 72 6e 61 6c 20 6e 75 6d 65 72 69 63 20 49 44  ernal numeric ID
16a0: 73 2c 20 6e 6f 74 20 61 6e 20 74 68 65 20 63 6f  s, not an the co
16b0: 72 72 65 73 70 6f 6e 64 69 6e 67 20 58 4d 4c 20  rresponding XML 
16c0: 74 61 67 20 76 61 6c 75 65 73 2e 3c 2f 6c 69 3e  tag values.</li>
16d0: 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c 68 32  ..</ul><br>..<h2
16e0: 3e 41 20 70 72 61 63 74 69 63 61 6c 20 74 75 74  >A practical tut
16f0: 6f 72 69 61 6c 20 62 79 20 72 65 61 6c 20 65 78  orial by real ex
1700: 61 6d 70 6c 65 73 3c 2f 68 32 3e 0d 0a 49 6e 20  amples</h2>..In 
1710: 74 68 69 73 20 65 78 61 6d 70 6c 65 20 77 65 27  this example we'
1720: 6c 6c 20 75 73 65 20 74 68 65 20 73 61 6d 70 6c  ll use the sampl
1730: 65 73 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 74  es contained int
1740: 6f 20 74 68 65 20 3c 62 3e 78 6d 6c 2d 73 61 6d  o the <b>xml-sam
1750: 70 6c 65 73 2f 69 73 6f 2d 6d 65 74 61 64 61 74  ples/iso-metadat
1760: 61 3c 2f 62 3e 20 66 6f 6c 64 65 72 2e 3c 62 72  a</b> folder.<br
1770: 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 65  >..<verbatim>..e
1780: 78 70 6f 72 74 20 22 53 50 41 54 49 41 4c 49 54  xport "SPATIALIT
1790: 45 5f 53 45 43 55 52 49 54 59 3d 72 65 6c 61 78  E_SECURITY=relax
17a0: 65 64 22 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  ed"..</verbatim>
17b0: 0d 0a 46 6f 72 20 64 69 64 61 63 74 69 63 20 73  ..For didactic s
17c0: 69 6d 70 6c 69 63 69 74 79 20 77 65 27 6c 6c 20  implicity we'll 
17d0: 75 73 65 20 74 68 65 20 3c 75 3e 75 6e 73 61 66  use the <u>unsaf
17e0: 65 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73 3c  e SQL functions<
17f0: 2f 75 3e 20 73 75 70 70 6f 72 74 69 6e 67 20 64  /u> supporting d
1800: 69 72 65 63 74 20 61 63 63 65 73 73 20 74 6f 20  irect access to 
1810: 65 78 74 65 72 6e 61 6c 20 66 69 6c 65 73 20 73  external files s
1820: 74 6f 72 65 64 20 69 6e 74 6f 20 74 68 65 20 3c  tored into the <
1830: 75 3e 66 69 6c 65 2d 73 79 73 74 65 6d 3c 2f 75  u>file-system</u
1840: 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 3c 62 3e 52 65  >.<br>..<u><b>Re
1850: 6d 65 6d 62 65 72 3c 2f 62 3e 3c 2f 75 3e 3a 20  member</b></u>: 
1860: 79 6f 75 20 68 61 76 65 20 74 6f 20 65 78 70 6c  you have to expl
1870: 69 63 69 74 6c 79 20 73 65 74 20 74 68 65 20 3c  icitly set the <
1880: 62 3e 53 50 41 54 49 41 4c 49 54 45 5f 53 45 43  b>SPATIALITE_SEC
1890: 55 52 49 54 59 3d 72 65 6c 61 78 65 64 3c 2f 62  URITY=relaxed</b
18a0: 3e 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61  > environment va
18b0: 72 69 61 62 6c 65 20 69 6e 20 6f 72 64 65 72 20  riable in order 
18c0: 74 6f 20 65 6e 61 62 6c 65 20 61 6c 6c 20 3c 75  to enable all <u
18d0: 3e 75 6e 73 61 66 65 3c 2f 75 3e 20 53 51 4c 20  >unsafe</u> SQL 
18e0: 49 6d 70 6f 72 74 2f 45 78 70 6f 72 74 20 66 75  Import/Export fu
18f0: 6e 63 74 69 6f 6e 73 2e 0d 0a 3c 76 65 72 62 61  nctions...<verba
1900: 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20 43 72 65  tim>..SELECT Cre
1910: 61 74 65 49 73 6f 4d 65 74 61 64 61 74 61 54 61  ateIsoMetadataTa
1920: 62 6c 65 73 28 29 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a  bles();..-----..
1930: 31 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  1..</verbatim>..
1940: 41 6e 64 20 77 65 27 6c 6c 20 73 75 70 70 6f 73  And we'll suppos
1950: 65 20 74 68 61 74 20 74 68 65 20 49 53 4f 20 4d  e that the ISO M
1960: 65 74 61 64 61 74 61 20 73 75 70 70 6f 72 74 69  etadata supporti
1970: 6e 67 20 74 61 62 6c 65 73 20 68 61 76 65 20 62  ng tables have b
1980: 65 65 6e 20 63 72 65 61 74 65 64 20 69 6e 20 3c  een created in <
1990: 62 3e 73 74 72 69 63 74 20 6d 6f 64 65 3c 2f 62  b>strict mode</b
19a0: 3e 2c 20 69 2e 65 2e 20 61 6c 77 61 79 73 20 72  >, i.e. always r
19b0: 65 71 75 69 72 69 6e 67 20 61 20 73 75 63 63 65  equiring a succe
19c0: 73 73 66 75 6c 20 58 4d 4c 20 53 63 68 65 6d 61  ssful XML Schema
19d0: 20 76 61 6c 69 64 61 74 69 6f 6e 2e 0d 0a 3c 76   validation...<v
19e0: 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54  erbatim>..SELECT
19f0: 20 52 65 67 69 73 74 65 72 49 73 6f 4d 65 74 61   RegisterIsoMeta
1a00: 64 61 74 61 28 20 27 64 61 74 61 73 65 74 27 2c  data( 'dataset',
1a10: 20 0d 0a 20 20 58 42 5f 43 72 65 61 74 65 28 20   ..  XB_Create( 
1a20: 58 42 5f 4c 6f 61 64 58 4d 4c 28 20 27 43 3a 2f  XB_LoadXML( 'C:/
1a30: 78 6d 6c 2d 73 61 6d 70 6c 65 73 2f 69 73 6f 2d  xml-samples/iso-
1a40: 6d 65 74 61 64 61 74 61 2f 69 6e 73 70 69 72 65  metadata/inspire
1a50: 2d 64 61 74 61 2d 65 78 61 6d 70 6c 65 2e 78 6d  -data-example.xm
1a60: 6c 27 20 29 20 29 20 29 3b 0d 0a 2d 2d 2d 2d 2d  l' ) ) );..-----
1a70: 0d 0a 30 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e  ..0..</verbatim>
1a80: 0d 0a 54 68 65 20 3c 62 3e 52 65 67 69 73 74 65  ..The <b>Registe
1a90: 72 49 73 6f 4d 65 74 61 64 61 74 61 3c 2f 62 3e  rIsoMetadata</b>
1aa0: 28 29 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20  () SQL function 
1ab0: 69 6e 73 65 72 74 73 20 61 20 72 65 67 69 73 74  inserts a regist
1ac0: 72 61 74 69 6f 6e 20 69 6e 74 6f 20 74 68 65 20  ration into the 
1ad0: 3c 62 3e 49 53 4f 5f 6d 65 74 61 64 61 74 61 3c  <b>ISO_metadata<
1ae0: 2f 62 3e 20 74 61 62 6c 65 2e 0d 0a 41 6e 79 20  /b> table...Any 
1af0: 61 74 74 65 6d 70 74 20 61 69 6d 65 64 20 74 6f  attempt aimed to
1b00: 20 64 69 72 65 63 74 6c 79 20 70 65 72 66 6f 72   directly perfor
1b10: 6d 20 61 6e 79 20 3c 62 3e 49 4e 53 45 52 54 3c  m any <b>INSERT<
1b20: 2f 62 3e 20 6f 72 20 3c 62 3e 55 50 44 41 54 45  /b> or <b>UPDATE
1b30: 3c 2f 62 3e 20 53 51 4c 20 73 74 61 74 65 6d 65  </b> SQL stateme
1b40: 6e 74 20 6f 6e 20 62 65 68 61 6c 66 20 6f 66 20  nt on behalf of 
1b50: 49 53 4f 5f 6d 65 74 61 64 61 74 61 20 69 73 20  ISO_metadata is 
1b60: 73 74 72 6f 6e 67 6c 79 20 64 69 73 63 6f 75 72  strongly discour
1b70: 61 67 65 64 3b 20 61 6c 77 61 79 73 20 75 73 69  aged; always usi
1b80: 6e 67 20 74 68 65 20 61 62 73 74 72 61 63 74 20  ng the abstract 
1b90: 66 75 6e 63 74 69 6f 6e 20 52 65 67 69 73 74 65  function Registe
1ba0: 72 49 73 6f 4d 65 74 61 64 61 74 61 28 29 20 69  rIsoMetadata() i
1bb0: 73 20 77 61 72 6d 6c 79 20 72 65 63 6f 6d 6d 65  s warmly recomme
1bc0: 6e 64 65 64 2c 20 61 6e 64 20 77 69 6c 6c 20 70  nded, and will p
1bd0: 72 65 73 65 72 76 65 20 6c 6f 6e 67 2d 74 65 72  reserve long-ter
1be0: 6d 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 79 20  m compatibility 
1bf0: 61 67 61 69 6e 73 74 20 73 75 62 73 65 71 75 65  against subseque
1c00: 6e 74 20 72 65 6c 65 61 73 65 73 2e 0d 0a 3c 75  nt releases...<u
1c10: 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e 52  l>..<li>the <b>R
1c20: 65 67 69 73 74 65 72 49 73 6f 4d 65 74 61 64 61  egisterIsoMetada
1c30: 74 61 28 29 3c 2f 62 3e 20 53 51 4c 20 66 75 6e  ta()</b> SQL fun
1c40: 63 74 69 6f 6e 20 69 6e 20 69 74 73 20 73 69 6d  ction in its sim
1c50: 70 6c 65 72 20 66 6f 72 6d 20 73 69 6d 70 6c 79  pler form simply
1c60: 20 72 65 71 75 69 72 65 73 20 70 61 73 73 69 6e   requires passin
1c70: 67 20 74 77 6f 20 61 72 67 75 6d 65 6e 74 73 3a  g two arguments:
1c80: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20  ..<ul>..<li>the 
1c90: 66 69 72 73 74 20 61 72 67 75 6d 65 6e 74 20 63  first argument c
1ca0: 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 3c 62 3e  orrespond to <b>
1cb0: 6d 64 5f 73 63 6f 70 65 3c 2f 62 3e 2e 3c 2f 6c  md_scope</b>.</l
1cc0: 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 73 65 63 6f  i>..<li>the seco
1cd0: 6e 64 20 61 72 67 75 6d 65 6e 74 20 69 73 20 65  nd argument is e
1ce0: 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 61 6e  xpected to be an
1cf0: 20 61 70 70 72 6f 70 72 69 61 74 65 20 3c 62 3e   appropriate <b>
1d00: 58 6d 6c 42 4c 4f 42 3c 2f 62 3e 20 63 6f 6e 74  XmlBLOB</b> cont
1d10: 61 69 6e 69 6e 67 20 74 68 65 20 4d 65 74 61 64  aining the Metad
1d20: 61 74 61 20 64 65 66 69 6e 69 74 69 6f 6e 2e 3c  ata definition.<
1d30: 62 72 3e 0d 0a 53 6f 20 77 65 27 76 65 20 75 73  br>..So we've us
1d40: 65 64 20 74 68 65 20 3c 62 3e 58 42 5f 43 72 65  ed the <b>XB_Cre
1d50: 61 74 65 28 29 3c 2f 62 3e 20 53 51 4c 20 66 75  ate()</b> SQL fu
1d60: 6e 63 74 69 6f 6e 20 69 6e 20 6f 72 64 65 72 20  nction in order 
1d70: 74 6f 20 63 72 65 61 74 65 20 61 20 76 61 6c 69  to create a vali
1d80: 64 20 3c 62 3e 58 6d 6c 42 4c 4f 42 3c 2f 62 3e  d <b>XmlBLOB</b>
1d90: 3b 20 61 6e 64 20 74 68 65 6e 20 69 6e 20 74 75  ; and then in tu
1da0: 72 6e 20 77 65 27 76 65 20 69 6e 76 6f 6b 65 64  rn we've invoked
1db0: 20 3c 62 3e 58 42 5f 4c 6f 61 64 58 4d 4c 28 29   <b>XB_LoadXML()
1dc0: 3c 2f 62 3e 20 69 6e 20 6f 72 64 65 72 20 74 6f  </b> in order to
1dd0: 20 70 72 6f 70 65 72 6c 79 20 6c 6f 61 64 20 74   properly load t
1de0: 68 65 20 58 4d 4c 20 44 6f 63 75 6d 65 6e 74 20  he XML Document 
1df0: 66 72 6f 6d 20 74 68 65 20 65 78 74 65 72 6e 61  from the externa
1e00: 6c 20 66 69 6c 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f  l file.</li>..</
1e10: 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d  ul></li>..</ul>.
1e20: 0a 41 6e 79 77 61 79 20 74 68 69 73 20 66 69 72  .Anyway this fir
1e30: 73 74 20 61 74 74 65 6d 70 74 20 77 61 73 20 75  st attempt was u
1e40: 6e 73 75 63 63 65 73 73 66 75 6c 3a 20 77 65 27  nsuccessful: we'
1e50: 76 65 20 67 65 74 20 61 20 3c 62 3e 30 3c 2f 62  ve get a <b>0</b
1e60: 3e 20 72 65 73 75 6c 74 2c 20 74 68 69 73 20 6d  > result, this m
1e70: 65 61 6e 69 6e 67 20 3c 75 3e 66 61 69 6c 75 72  eaning <u>failur
1e80: 65 3c 2f 75 3e 2e 3c 62 72 3e 0d 0a 54 68 65 72  e</u>.<br>..Ther
1e90: 65 20 69 73 20 76 65 72 79 20 73 69 6d 70 6c 65  e is very simple
1ea0: 20 72 65 61 73 6f 6e 20 61 63 63 6f 75 6e 74 69   reason accounti
1eb0: 6e 67 20 66 6f 72 20 74 68 69 73 20 66 61 69 6c  ng for this fail
1ec0: 75 72 65 3a 20 3c 75 3e 77 65 27 76 65 20 6d 69  ure: <u>we've mi
1ed0: 73 73 65 64 20 74 6f 20 70 65 72 66 6f 72 6d 20  ssed to perform 
1ee0: 61 6e 79 20 58 4d 4c 20 53 63 68 65 6d 61 20 76  any XML Schema v
1ef0: 61 6c 69 64 61 74 69 6f 6e 3c 2f 75 3e 3b 20 61  alidation</u>; a
1f00: 6e 64 20 61 63 63 6f 72 64 69 6e 67 6c 79 20 74  nd accordingly t
1f10: 6f 20 74 68 69 73 20 74 68 65 20 73 61 66 65 74  o this the safet
1f20: 79 20 54 72 69 67 67 65 72 20 68 61 73 20 74 68  y Trigger has th
1f30: 65 6e 20 72 65 6a 65 63 74 65 64 20 74 68 69 73  en rejected this
1f40: 20 66 69 72 73 74 20 61 74 74 65 6d 70 74 2e 0d   first attempt..
1f50: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c  .<verbatim>..SEL
1f60: 45 43 54 20 52 65 67 69 73 74 65 72 49 73 6f 4d  ECT RegisterIsoM
1f70: 65 74 61 64 61 74 61 28 20 27 64 61 74 61 73 65  etadata( 'datase
1f80: 74 27 2c 20 0d 0a 20 20 58 42 5f 43 72 65 61 74  t', ..  XB_Creat
1f90: 65 28 20 58 42 5f 4c 6f 61 64 58 4d 4c 28 20 27  e( XB_LoadXML( '
1fa0: 43 3a 2f 78 6d 6c 2d 73 61 6d 70 6c 65 73 2f 69  C:/xml-samples/i
1fb0: 73 6f 2d 6d 65 74 61 64 61 74 61 2f 69 6e 73 70  so-metadata/insp
1fc0: 69 72 65 2d 64 61 74 61 2d 65 78 61 6d 70 6c 65  ire-data-example
1fd0: 2e 78 6d 6c 27 20 29 2c 0d 0a 20 20 20 20 31 2c  .xml' ),..    1,
1fe0: 20 31 20 29 20 29 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a   1 ) );..-----..
1ff0: 31 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  1..</verbatim>..
2000: 54 68 69 73 20 73 65 63 6f 6e 64 20 61 74 74 65  This second atte
2010: 6d 70 74 20 69 73 20 66 69 6e 61 6c 6c 79 20 73  mpt is finally s
2020: 75 63 63 65 73 73 66 75 6c 2c 20 62 65 63 61 75  uccessful, becau
2030: 73 65 20 74 68 69 73 20 74 69 6d 65 20 77 65 27  se this time we'
2040: 76 65 20 63 6f 72 72 65 63 74 6c 79 20 69 6e 76  ve correctly inv
2050: 6f 6b 65 64 20 3c 62 3e 58 42 5f 43 72 65 61 74  oked <b>XB_Creat
2060: 65 28 29 3c 2f 62 3e 20 61 73 6b 69 6e 67 20 66  e()</b> asking f
2070: 6f 72 20 66 75 6c 6c 20 58 4d 4c 20 53 63 68 65  or full XML Sche
2080: 6d 61 20 76 61 6c 69 64 61 74 69 6f 6e 2e 0d 0a  ma validation...
2090: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45  <verbatim>..SELE
20a0: 43 54 20 52 65 67 69 73 74 65 72 49 73 6f 4d 65  CT RegisterIsoMe
20b0: 74 61 64 61 74 61 28 20 27 64 61 74 61 73 65 74  tadata( 'dataset
20c0: 27 2c 20 0d 0a 20 20 58 42 5f 43 72 65 61 74 65  ', ..  XB_Create
20d0: 28 20 58 42 5f 4c 6f 61 64 58 4d 4c 28 20 27 43  ( XB_LoadXML( 'C
20e0: 3a 2f 78 6d 6c 2d 73 61 6d 70 6c 65 73 2f 69 73  :/xml-samples/is
20f0: 6f 2d 6d 65 74 61 64 61 74 61 2f 69 6e 73 70 69  o-metadata/inspi
2100: 72 65 2d 64 61 74 61 2d 65 78 61 6d 70 6c 65 2e  re-data-example.
2110: 78 6d 6c 27 20 29 2c 0d 0a 20 20 20 20 31 2c 20  xml' ),..    1, 
2120: 31 20 29 20 29 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a 30  1 ) );..-----..0
2130: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41  ..</verbatim>..A
2140: 6e 79 77 61 79 20 61 20 73 65 63 6f 6e 64 20 61  nyway a second a
2150: 74 74 65 6d 70 74 20 74 6f 20 69 6e 73 65 72 74  ttempt to insert
2160: 20 79 65 74 20 61 6e 6f 74 68 65 72 20 74 69 6d   yet another tim
2170: 65 20 74 68 65 20 73 61 6d 65 20 4d 65 74 61 64  e the same Metad
2180: 61 74 61 20 64 6f 63 75 6d 65 6e 74 20 77 69 6c  ata document wil
2190: 6c 20 62 65 20 72 65 6a 65 63 74 65 64 3b 20 74  l be rejected; t
21a0: 68 69 73 20 69 73 20 62 65 63 61 75 73 65 20 61  his is because a
21b0: 20 3c 75 3e 75 6e 69 71 75 65 6e 65 73 73 20 63   <u>uniqueness c
21c0: 6f 6e 73 74 72 61 69 6e 74 3c 2f 75 3e 20 66 6f  onstraint</u> fo
21d0: 72 62 69 64 73 20 74 6f 20 69 6e 73 65 72 74 20  rbids to insert 
21e0: 74 77 6f 20 64 6f 63 75 6d 65 6e 74 73 20 64 65  two documents de
21f0: 63 6c 61 72 69 6e 67 20 74 68 65 20 73 61 6d 65  claring the same
2200: 20 3c 62 3e 66 69 6c 65 49 64 3c 2f 62 3e 20 76   <b>fileId</b> v
2210: 61 6c 75 65 2e 0d 0a 3c 76 65 72 62 61 74 69 6d  alue...<verbatim
2220: 3e 0d 0a 53 45 4c 45 43 54 20 52 65 67 69 73 74  >..SELECT Regist
2230: 65 72 49 73 6f 4d 65 74 61 64 61 74 61 28 20 27  erIsoMetadata( '
2240: 64 61 74 61 73 65 74 27 2c 20 0d 0a 20 20 58 42  dataset', ..  XB
2250: 5f 43 72 65 61 74 65 28 20 58 42 5f 4c 6f 61 64  _Create( XB_Load
2260: 58 4d 4c 28 20 27 43 3a 2f 78 6d 6c 2d 73 61 6d  XML( 'C:/xml-sam
2270: 70 6c 65 73 2f 69 73 6f 2d 6d 65 74 61 64 61 74  ples/iso-metadat
2280: 61 2f 64 62 5f 74 6f 70 6f 67 72 61 66 69 63 6f  a/db_topografico
2290: 5f 69 73 6f 31 39 31 33 39 2e 78 6d 6c 27 20 29  _iso19139.xml' )
22a0: 2c 0d 0a 20 20 20 20 31 2c 20 31 20 29 20 29 3b  ,..    1, 1 ) );
22b0: 0d 0a 2d 2d 2d 2d 2d 0d 0a 31 0d 0a 0d 0a 53 45  ..-----..1....SE
22c0: 4c 45 43 54 20 52 65 67 69 73 74 65 72 49 73 6f  LECT RegisterIso
22d0: 4d 65 74 61 64 61 74 61 28 20 27 64 61 74 61 73  Metadata( 'datas
22e0: 65 74 27 2c 20 0d 0a 20 20 58 42 5f 43 72 65 61  et', ..  XB_Crea
22f0: 74 65 28 20 58 42 5f 4c 6f 61 64 58 4d 4c 28 20  te( XB_LoadXML( 
2300: 27 43 3a 2f 78 6d 6c 2d 73 61 6d 70 6c 65 73 2f  'C:/xml-samples/
2310: 69 73 6f 2d 6d 65 74 61 64 61 74 61 2f 75 6e 69  iso-metadata/uni
2320: 74 61 5f 76 6f 6c 75 6d 65 74 72 69 63 61 5f 69  ta_volumetrica_i
2330: 73 6f 31 39 31 33 39 2e 78 6d 6c 27 20 29 2c 0d  so19139.xml' ),.
2340: 0a 20 20 20 20 31 2c 20 31 20 29 2c 20 32 20 29  .    1, 1 ), 2 )
2350: 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a 31 0d 0a 0d 0a 53  ;..-----..1....S
2360: 45 4c 45 43 54 20 52 65 67 69 73 74 65 72 49 73  ELECT RegisterIs
2370: 6f 4d 65 74 61 64 61 74 61 28 20 27 64 61 74 61  oMetadata( 'data
2380: 73 65 74 27 2c 20 0d 0a 20 20 58 42 5f 43 72 65  set', ..  XB_Cre
2390: 61 74 65 28 20 58 42 5f 4c 6f 61 64 58 4d 4c 28  ate( XB_LoadXML(
23a0: 20 27 43 3a 2f 78 6d 6c 2d 73 61 6d 70 6c 65 73   'C:/xml-samples
23b0: 2f 69 73 6f 2d 6d 65 74 61 64 61 74 61 2f 75 6e  /iso-metadata/un
23c0: 69 74 61 5f 69 6e 73 65 64 69 61 74 69 76 61 5f  ita_insediativa_
23d0: 69 73 6f 31 39 31 33 39 2e 78 6d 6c 27 20 29 2c  iso19139.xml' ),
23e0: 0d 0a 20 20 20 20 31 2c 20 31 20 29 2c 20 27 66  ..    1, 1 ), 'f
23f0: 30 37 38 30 63 34 31 2d 30 32 33 64 2d 34 31 62  0780c41-023d-41b
2400: 65 2d 39 65 64 34 2d 66 37 39 62 64 62 34 61 37  e-9ed4-f79bdb4a7
2410: 38 38 36 27 20 29 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a  886' );..-----..
2420: 31 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a  1..</verbatim>..
2430: 3c 75 3e 50 6c 65 61 73 65 20 6e 6f 74 65 3c 2f  <u>Please note</
2440: 75 3e 3a 20 74 68 65 20 3c 62 3e 52 65 67 69 73  u>: the <b>Regis
2450: 74 65 72 49 73 6f 4d 65 74 61 64 61 74 61 28 29  terIsoMetadata()
2460: 3c 2f 62 3e 20 66 75 6e 63 74 69 6f 6e 20 63 61  </b> function ca
2470: 6e 20 62 65 20 61 6c 73 6f 20 69 6e 76 6f 6b 65  n be also invoke
2480: 64 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 75 70  d in order to up
2490: 64 61 74 65 20 61 6e 20 61 6c 72 65 61 64 79 20  date an already 
24a0: 64 65 66 69 6e 65 64 20 4d 65 74 61 64 61 74 61  defined Metadata
24b0: 20 64 6f 63 75 6d 65 6e 74 3b 20 69 6e 20 74 68   document; in th
24c0: 69 73 20 63 61 73 65 20 79 6f 75 20 73 69 6d 70  is case you simp
24d0: 6c 79 20 68 61 76 65 20 74 6f 20 70 61 73 73 20  ly have to pass 
24e0: 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e  the correspondin
24f0: 67 20 3c 62 3e 69 64 3c 2f 62 3e 20 61 73 20 74  g <b>id</b> as t
2500: 68 65 20 74 68 69 72 64 20 61 72 67 75 6d 65 6e  he third argumen
2510: 74 2e 3c 62 72 3e 0d 0a 41 6c 74 65 72 6e 61 74  t.<br>..Alternat
2520: 69 76 65 6c 79 2c 20 69 66 20 74 68 65 20 4d 65  ively, if the Me
2530: 74 61 64 61 74 61 20 64 6f 63 75 6d 65 6e 74 20  tadata document 
2540: 74 6f 20 62 65 20 72 65 70 6c 61 63 65 64 2f 75  to be replaced/u
2550: 70 64 61 74 65 64 20 64 65 63 6c 61 72 65 73 20  pdated declares 
2560: 61 6e 20 69 6e 74 65 72 6e 61 6c 20 3c 62 3e 26  an internal <b>&
2570: 6c 74 3b 66 69 6c 65 49 64 65 6e 74 69 66 69 65  lt;fileIdentifie
2580: 72 26 67 74 3b 3c 2f 62 3e 20 74 61 67 20 76 61  r&gt;</b> tag va
2590: 6c 75 65 2c 20 79 6f 75 20 63 61 6e 20 70 61 73  lue, you can pas
25a0: 73 20 74 68 65 20 3c 62 3e 66 69 6c 65 49 44 3c  s the <b>fileID<
25b0: 2f 62 3e 20 76 61 6c 75 65 20 61 73 20 74 68 65  /b> value as the
25c0: 20 74 68 69 72 64 20 61 72 67 75 6d 65 6e 74 2e   third argument.
25d0: 3c 62 72 3e 0d 0a 49 6e 20 61 6e 79 20 63 61 73  <br>..In any cas
25e0: 65 20 62 6f 74 68 20 3c 62 3e 66 69 6c 65 49 64  e both <b>fileId
25f0: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 70 61 72 65  </b> and <b>pare
2600: 6e 74 49 64 3c 2f 62 3e 20 77 69 6c 6c 20 62 65  ntId</b> will be
2610: 20 63 6f 72 72 65 63 74 6c 79 20 75 70 64 61 74   correctly updat
2620: 65 64 20 73 6f 20 74 6f 20 65 78 61 63 74 6c 79  ed so to exactly
2630: 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 74   correspond to t
2640: 68 65 20 69 6e 74 65 72 6e 61 6c 20 74 61 67 73  he internal tags
2650: 20 64 65 63 6c 61 72 65 64 20 77 69 74 68 69 6e   declared within
2660: 20 74 68 65 20 58 4d 4c 20 64 6f 63 75 6d 65 6e   the XML documen
2670: 74 73 20 69 74 73 65 6c 66 3b 20 79 6f 75 20 63  ts itself; you c
2680: 61 6e 20 73 61 66 65 6c 79 20 72 65 6c 79 20 6f  an safely rely o
2690: 6e 20 74 68 69 73 2c 20 62 65 63 61 75 73 65 20  n this, because 
26a0: 61 20 63 6f 75 70 6c 65 20 6f 66 20 54 72 69 67  a couple of Trig
26b0: 67 65 72 73 20 77 69 6c 6c 20 61 6c 77 61 79 73  gers will always
26c0: 20 74 61 6b 65 20 63 61 72 65 20 74 6f 20 65 6e   take care to en
26d0: 73 75 72 65 20 61 20 73 74 72 69 63 74 20 63 6f  sure a strict co
26e0: 72 72 65 73 70 6f 6e 64 65 6e 63 65 2e 3c 62 72  rrespondence.<br
26f0: 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c 76 65  ><br>..<hr>..<ve
2700: 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 54 20  rbatim>..SELECT 
2710: 2a 0d 0a 46 52 4f 4d 20 49 53 4f 5f 6d 65 74 61  *..FROM ISO_meta
2720: 64 61 74 61 5f 76 69 65 77 3b 0d 0a 3c 2f 76 65  data_view;..</ve
2730: 72 62 61 74 69 6d 3e 0d 0a 3c 74 61 62 6c 65 20  rbatim>..<table 
2740: 62 6f 72 64 65 72 3d 22 31 22 20 63 65 6c 6c 73  border="1" cells
2750: 70 61 63 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70  pacing="4" cellp
2760: 61 64 64 69 6e 67 3d 22 34 22 3e 0d 0a 3c 74 72  adding="4">..<tr
2770: 3e 3c 74 68 3e 69 64 3c 2f 74 68 3e 3c 74 68 3e  ><th>id</th><th>
2780: 6d 64 5f 73 63 6f 70 65 3c 2f 74 68 3e 3c 74 68  md_scope</th><th
2790: 3e 74 69 74 6c 65 3c 2f 74 68 3e 3c 74 68 3e 61  >title</th><th>a
27a0: 62 73 74 72 61 63 74 3c 2f 74 68 3e 0d 0a 3c 74  bstract</th>..<t
27b0: 68 3e 67 65 6f 6d 65 74 72 79 3c 2f 74 68 3e 3c  h>geometry</th><
27c0: 74 68 3e 66 69 6c 65 49 64 65 6e 74 69 66 69 65  th>fileIdentifie
27d0: 72 3c 2f 74 68 3e 3c 74 68 3e 70 61 72 65 6e 74  r</th><th>parent
27e0: 49 64 65 6e 74 69 66 69 65 72 3c 2f 74 68 3e 3c  Identifier</th><
27f0: 74 68 3e 6d 65 74 61 64 61 74 61 3c 2f 74 68 3e  th>metadata</th>
2800: 3c 74 68 3e 73 63 68 65 6d 61 5f 76 61 6c 69 64  <th>schema_valid
2810: 61 74 65 64 3c 2f 74 68 3e 3c 74 68 3e 6d 65 74  ated</th><th>met
2820: 61 64 61 74 61 5f 73 63 68 65 6d 61 5f 75 72 69  adata_schema_uri
2830: 3c 2f 74 68 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </th></tr>..<tr>
2840: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
2850: 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e 75 6e 64 65  ">0</td><td>unde
2860: 66 69 6e 65 64 3c 2f 74 64 3e 3c 74 64 3e 4e 55  fined</td><td>NU
2870: 4c 4c 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c  LL</td><td>NULL<
2880: 2f 74 64 3e 0d 0a 3c 74 64 3e 4e 55 4c 4c 3c 2f  /td>..<td>NULL</
2890: 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e  td><td>NULL</td>
28a0: 3c 74 64 3e 4e 55 4c 4c 3c 2f 74 64 3e 3c 74 64  <td>NULL</td><td
28b0: 3e 42 4c 4f 42 20 73 7a 3d 34 20 55 4e 4b 4e 4f  >BLOB sz=4 UNKNO
28c0: 57 4e 20 74 79 70 65 3c 2f 74 64 3e 3c 74 64 20  WN type</td><td 
28d0: 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 2d 31  align="right">-1
28e0: 3c 2f 74 64 3e 3c 74 64 3e 4e 55 4c 4c 3c 2f 74  </td><td>NULL</t
28f0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
2900: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31   align="right">1
2910: 3c 2f 74 64 3e 3c 74 64 3e 64 61 74 61 73 65 74  </td><td>dataset
2920: 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 49 6d 61 67 65  </td>..<td>Image
2930: 32 30 30 30 20 50 72 6f 64 75 63 74 20 31 20 28  2000 Product 1 (
2940: 6e 6c 32 29 20 4d 75 6c 74 69 73 70 65 63 74 72  nl2) Multispectr
2950: 61 6c 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 49 4d 41  al</td>..<td>IMA
2960: 47 45 32 30 30 30 20 70 72 6f 64 75 63 74 20 31  GE2000 product 1
2970: 20 69 6e 64 69 76 69 64 75 61 6c 20 6f 72 74 68   individual orth
2980: 6f 72 65 63 74 69 66 69 65 64 20 73 63 65 6e 65  orectified scene
2990: 73 20 2e 2e 2e 3c 2f 74 64 3e 0d 0a 3c 74 64 3e  s ...</td>..<td>
29a0: 42 4c 4f 42 20 73 7a 3d 31 34 31 20 47 45 4f 4d  BLOB sz=141 GEOM
29b0: 45 54 52 59 3c 2f 74 64 3e 3c 74 64 3e 30 32 39  ETRY</td><td>029
29c0: 30 39 37 66 64 2d 32 65 66 32 2d 34 38 37 63 2d  097fd-2ef2-487c-
29d0: 61 35 63 61 2d 36 65 63 37 61 33 64 62 61 63 35  a5ca-6ec7a3dbac5
29e0: 33 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 4e 55 4c 4c  3</td>..<td>NULL
29f0: 3c 2f 74 64 3e 3c 74 64 3e 58 6d 6c 42 4c 4f 42  </td><td>XmlBLOB
2a00: 2d 49 53 4f 6d 65 74 61 64 61 74 61 20 73 7a 3d  -ISOmetadata sz=
2a10: 34 34 32 33 20 28 58 4d 4c 73 7a 3d 31 38 30 32  4423 (XMLsz=1802
2a20: 36 29 20 53 63 68 65 6d 61 56 61 6c 69 64 61 74  6) SchemaValidat
2a30: 65 64 3c 2f 74 64 3e 0d 0a 3c 74 64 20 61 6c 69  ed</td>..<td ali
2a40: 67 6e 3d 22 72 69 67 68 74 22 3e 31 3c 2f 74 64  gn="right">1</td
2a50: 3e 0d 0a 3c 74 64 3e 68 74 74 70 3a 2f 2f 73 63  >..<td>http://sc
2a60: 68 65 6d 61 73 2e 6f 70 65 6e 67 69 73 2e 6e 65  hemas.opengis.ne
2a70: 74 2f 69 73 6f 2f 31 39 31 33 39 2f 32 30 30 36  t/iso/19139/2006
2a80: 30 35 30 34 2f 67 6d 64 2f 67 6d 64 2e 78 73 64  0504/gmd/gmd.xsd
2a90: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e  </td></tr>..<tr>
2aa0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74  <td align="right
2ab0: 22 3e 32 3c 2f 74 64 3e 3c 74 64 3e 64 61 74 61  ">2</td><td>data
2ac0: 73 65 74 3c 2f 74 64 3e 3c 74 64 3e 55 6e 69 74  set</td><td>Unit
2ad0: 61 27 20 49 6e 73 65 64 69 61 74 69 76 61 3c 2f  a' Insediativa</
2ae0: 74 64 3e 0d 0a 3c 74 64 3e 41 72 65 65 20 61 64  td>..<td>Aree ad
2af0: 69 62 69 74 65 20 61 6c 6c 27 69 6e 73 74 61 6c  ibite all'instal
2b00: 6c 61 7a 69 6f 6e 65 20 2e 2e 2e 3c 2f 74 64 3e  lazione ...</td>
2b10: 0d 0a 3c 74 64 3e 42 4c 4f 42 20 73 7a 3d 31 34  ..<td>BLOB sz=14
2b20: 31 20 47 45 4f 4d 45 54 52 59 3c 2f 74 64 3e 3c  1 GEOMETRY</td><
2b30: 74 64 3e 63 64 37 36 63 39 61 32 2d 38 31 33 38  td>cd76c9a2-8138
2b40: 2d 34 65 37 65 2d 61 64 36 62 2d 32 65 31 30 35  -4e7e-ad6b-2e105
2b50: 63 33 37 65 36 35 63 3c 2f 74 64 3e 0d 0a 3c 74  c37e65c</td>..<t
2b60: 64 3e 63 63 32 37 64 38 38 35 2d 32 37 39 35 2d  d>cc27d885-2795-
2b70: 34 39 39 38 2d 39 62 61 65 2d 36 66 36 38 37 32  4998-9bae-6f6872
2b80: 62 31 38 31 63 65 3c 2f 74 64 3e 0d 0a 3c 74 64  b181ce</td>..<td
2b90: 3e 58 6d 6c 42 4c 4f 42 2d 49 53 4f 6d 65 74 61  >XmlBLOB-ISOmeta
2ba0: 64 61 74 61 20 73 7a 3d 37 33 35 35 20 28 58 4d  data sz=7355 (XM
2bb0: 4c 73 7a 3d 35 38 30 39 38 29 20 53 63 68 65 6d  Lsz=58098) Schem
2bc0: 61 56 61 6c 69 64 61 74 65 64 3c 2f 74 64 3e 0d  aValidated</td>.
2bd0: 0a 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68  .<td align="righ
2be0: 74 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 68 74 74  t">1</td><td>htt
2bf0: 70 3a 2f 2f 77 77 77 2e 69 73 6f 74 63 32 31 31  p://www.isotc211
2c00: 2e 6f 72 67 2f 32 30 30 35 2f 67 6d 64 2f 67 6d  .org/2005/gmd/gm
2c10: 64 2e 78 73 64 3c 2f 74 64 3e 3c 2f 74 72 3e 0d  d.xsd</td></tr>.
2c20: 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 54  .</table><br>..T
2c30: 68 65 20 3c 62 3e 49 53 4f 5f 6d 65 74 61 64 61  he <b>ISO_metada
2c40: 74 61 3c 2f 62 3e 20 74 61 62 6c 65 20 69 73 20  ta</b> table is 
2c50: 73 75 70 70 6f 72 74 65 64 20 62 79 20 61 20 63  supported by a c
2c60: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 56 49 45  orresponding VIE
2c70: 57 20 28 6e 6f 74 20 73 75 72 70 72 69 73 69 6e  W (not surprisin
2c80: 67 6c 79 29 20 6e 61 6d 65 64 20 3c 62 3e 49 53  gly) named <b>IS
2c90: 4f 5f 6d 65 74 61 64 61 74 61 5f 76 69 65 77 3c  O_metadata_view<
2ca0: 2f 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 50 6c 65  /b>.<br>..<u>Ple
2cb0: 61 73 65 20 6e 6f 74 65 3c 2f 75 3e 3a 20 61 20  ase note</u>: a 
2cc0: 3c 75 3e 64 65 66 61 75 6c 74 20 72 6f 77 3c 2f  <u>default row</
2cd0: 75 3e 20 69 64 65 6e 74 69 66 69 65 64 20 62 79  u> identified by
2ce0: 20 3c 62 3e 69 64 3d 30 3c 2f 62 3e 20 69 73 20   <b>id=0</b> is 
2cf0: 61 6c 77 61 79 73 20 64 65 66 69 6e 65 64 20 69  always defined i
2d00: 6e 20 74 68 65 20 3c 62 3e 49 53 4f 5f 6d 65 74  n the <b>ISO_met
2d10: 61 64 61 74 61 3c 2f 62 3e 20 74 61 62 6c 65 20  adata</b> table 
2d20: 28 62 65 69 6e 67 20 61 75 74 6f 6d 61 74 69 63  (being automatic
2d30: 61 6c 6c 79 20 63 72 65 61 74 65 64 20 62 79 20  ally created by 
2d40: 3c 62 3e 43 72 65 61 74 65 49 73 6f 4d 65 74 61  <b>CreateIsoMeta
2d50: 64 61 74 61 28 29 3c 2f 62 3e 29 3b 20 69 74 73  data()</b>); its
2d60: 20 69 6e 74 65 6e 64 65 64 20 73 63 6f 70 65 20   intended scope 
2d70: 69 73 20 74 68 65 20 6f 6e 65 20 74 6f 20 64 65  is the one to de
2d80: 66 69 6e 65 20 6b 69 6e 64 2d 6f 66 20 3c 75 3e  fine kind-of <u>
2d90: 75 6e 69 76 65 72 73 61 6c 2d 70 6c 61 63 65 68  universal-placeh
2da0: 6f 6c 64 65 72 3c 2f 75 3e 20 61 6c 6c 6f 77 69  older</u> allowi
2db0: 6e 67 20 74 6f 20 64 65 66 69 6e 65 20 3c 75 3e  ng to define <u>
2dc0: 75 6e 64 65 66 69 6e 65 64 2f 75 6e 6b 6e 6f 77  undefined/unknow
2dd0: 6e 3c 2f 75 3e 20 6d 65 74 61 64 61 74 61 20 72  n</u> metadata r
2de0: 65 66 65 72 65 6e 63 65 73 20 73 74 69 6c 6c 20  eferences still 
2df0: 70 72 65 73 65 72 76 69 6e 67 20 66 75 6c 6c 20  preserving full 
2e00: 72 65 6c 61 74 69 6f 6e 61 6c 20 69 6e 74 65 67  relational integ
2e10: 72 69 74 79 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 49  rity.<br><br>..I
2e20: 66 20 79 6f 75 20 61 72 65 20 63 75 72 69 6f 75  f you are curiou
2e30: 73 20 65 6e 6f 75 67 68 2c 20 79 6f 75 27 6c 6c  s enough, you'll
2e40: 20 71 75 69 63 6b 6c 79 20 64 69 73 63 6f 76 65   quickly discove
2e50: 72 20 74 68 61 74 20 74 68 69 73 20 56 49 45 57  r that this VIEW
2e60: 20 65 78 61 63 74 6c 79 20 63 6f 72 72 65 73 70   exactly corresp
2e70: 6f 6e 64 73 20 74 6f 20 74 68 65 20 6f 72 69 67  onds to the orig
2e80: 69 6e 61 6c 20 74 61 62 6c 65 2c 20 61 6e 64 20  inal table, and 
2e90: 74 68 61 74 20 69 74 73 20 61 64 64 65 64 20 76  that its added v
2ea0: 61 6c 75 65 73 20 69 73 20 69 6e 20 74 68 61 74  alues is in that
2eb0: 20 66 75 72 74 68 65 72 20 3c 62 3e 74 69 74 6c   further <b>titl
2ec0: 65 3c 2f 62 3e 2c 20 3c 62 3e 61 62 73 74 72 61  e</b>, <b>abstra
2ed0: 63 74 3c 2f 62 3e 2c 20 3c 62 3e 67 65 6f 6d 65  ct</b>, <b>geome
2ee0: 74 72 79 28 2a 29 3c 2f 62 3e 2c 20 3c 62 3e 66  try(*)</b>, <b>f
2ef0: 69 6c 65 49 64 28 2a 29 3c 2f 62 3e 2c 20 3c 62  ileId(*)</b>, <b
2f00: 3e 70 61 72 65 6e 74 49 64 28 2a 29 3c 2f 62 3e  >parentId(*)</b>
2f10: 2c 20 3c 62 3e 73 63 68 65 6d 61 5f 76 61 6c 69  , <b>schema_vali
2f20: 64 61 74 65 64 3c 2f 62 3e 20 61 6e 64 20 3c 62  dated</b> and <b
2f30: 3e 6d 65 74 61 64 61 74 61 5f 73 63 68 65 6d 61  >metadata_schema
2f40: 5f 75 72 69 3c 2f 62 3e 20 63 6f 6c 75 6d 6e 73  _uri</b> columns
2f50: 20 61 72 65 20 6d 61 64 65 20 69 6d 6d 65 64 69   are made immedi
2f60: 61 74 65 6c 79 20 61 76 61 69 6c 61 62 6c 65 2e  ately available.
2f70: 3c 62 72 3e 0d 0a 3c 75 3e 28 2a 29 50 6c 65 61  <br>..<u>(*)Plea
2f80: 73 65 20 6e 6f 74 65 3c 2f 75 3e 3a 20 74 68 65  se note</u>: the
2f90: 20 3c 62 3e 67 65 6f 6d 65 74 72 79 3c 2f 62 3e   <b>geometry</b>
2fa0: 2c 20 3c 62 3e 66 69 6c 65 49 64 3c 2f 62 3e 20  , <b>fileId</b> 
2fb0: 61 6e 64 20 3c 62 3e 70 61 72 65 6e 74 49 64 3c  and <b>parentId<
2fc0: 2f 62 3e 20 63 6f 6c 75 6d 6e 73 20 61 72 65 20  /b> columns are 
2fd0: 61 6c 77 61 79 73 20 64 69 72 65 63 74 6c 79 20  always directly 
2fe0: 65 78 70 6f 73 65 64 20 69 6e 20 74 68 65 20 62  exposed in the b
2ff0: 61 73 65 20 74 61 62 6c 65 3b 20 61 6c 6c 20 74  ase table; all t
3000: 68 65 6d 20 61 72 65 20 69 6d 6d 65 64 69 61 74  hem are immediat
3010: 65 6c 79 20 73 65 74 20 62 79 20 61 70 70 72 6f  ely set by appro
3020: 70 72 69 61 74 65 20 3c 62 3e 54 72 69 67 67 65  priate <b>Trigge
3030: 72 73 3c 2f 62 3e 2c 20 73 6f 20 74 6f 20 61 6c  rs</b>, so to al
3040: 77 61 79 73 20 63 6f 72 72 65 73 70 6f 6e 64 20  ways correspond 
3050: 74 6f 20 74 68 65 20 61 63 74 75 61 6c 20 74 61  to the actual ta
3060: 67 2d 76 61 6c 75 65 73 20 69 6e 74 65 72 6e 61  g-values interna
3070: 6c 6c 79 20 64 65 63 6c 61 72 65 64 20 62 79 20  lly declared by 
3080: 74 68 65 20 58 4d 4c 20 64 6f 63 75 6d 65 6e 74  the XML document
3090: 20 69 74 73 65 6c 66 2e 3c 62 72 3e 0d 0a 54 68   itself.<br>..Th
30a0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 53 51 4c 20  e following SQL 
30b0: 66 75 6e 63 74 69 6f 6e 73 2c 20 6f 6e 63 65 20  functions, once 
30c0: 69 6e 76 6f 6b 65 64 20 6f 6e 20 62 65 68 61 6c  invoked on behal
30d0: 66 20 6f 66 20 74 68 65 20 58 6d 6c 42 4c 4f 42  f of the XmlBLOB
30e0: 20 70 61 79 6c 6f 61 64 20 28 3c 62 3e 6d 65 74   payload (<b>met
30f0: 61 64 61 74 61 3c 2f 62 3e 29 2c 20 77 69 6c 6c  adata</b>), will
3100: 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 65 78 74   immediately ext
3110: 72 61 63 74 20 74 68 65 20 63 6f 72 72 65 73 70  ract the corresp
3120: 6f 6e 64 69 6e 67 20 76 61 6c 75 65 73 20 66 72  onding values fr
3130: 6f 6d 20 77 69 74 68 69 6e 20 74 68 65 20 58 4d  om within the XM
3140: 4c 20 64 6f 63 75 6d 65 6e 74 3a 20 3c 62 3e 58  L document: <b>X
3150: 42 5f 47 65 74 54 69 74 6c 65 28 29 3c 2f 62 3e  B_GetTitle()</b>
3160: 2c 20 3c 62 3e 58 42 5f 47 65 74 41 62 73 74 72  , <b>XB_GetAbstr
3170: 61 63 74 28 29 3c 2f 62 3e 2c 20 3c 62 3e 58 42  act()</b>, <b>XB
3180: 5f 47 65 74 47 65 6f 6d 65 74 72 79 28 29 3c 2f  _GetGeometry()</
3190: 62 3e 2c 20 3c 62 3e 58 42 5f 47 65 74 46 69 6c  b>, <b>XB_GetFil
31a0: 65 49 64 28 29 3c 2f 62 3e 2c 20 3c 62 3e 58 42  eId()</b>, <b>XB
31b0: 5f 47 65 74 50 61 72 65 6e 74 49 64 28 29 3c 2f  _GetParentId()</
31c0: 62 3e 2c 20 3c 62 3e 58 42 5f 49 73 53 63 68 65  b>, <b>XB_IsSche
31d0: 6d 61 56 61 6c 69 64 61 74 65 64 28 29 3c 2f 62  maValidated()</b
31e0: 3e 20 61 6e 64 20 3c 62 3e 58 42 5f 47 65 74 53  > and <b>XB_GetS
31f0: 63 68 65 6d 61 55 52 49 28 29 3c 2f 62 3e 2e 3c  chemaURI()</b>.<
3200: 62 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a 3c  br><br>..<hr>..<
3210: 68 33 3e 61 64 76 61 6e 63 65 64 20 53 51 4c 20  h3>advanced SQL 
3220: 66 75 6e 63 74 69 6f 6e 73 20 73 75 70 70 6f 72  functions suppor
3230: 74 69 6e 67 20 49 53 4f 20 4d 65 74 61 64 61 74  ting ISO Metadat
3240: 61 3c 2f 68 33 3e 0d 0a 3c 76 65 72 62 61 74 69  a</h3>..<verbati
3250: 6d 3e 0d 0a 53 45 4c 45 43 54 20 47 65 74 49 73  m>..SELECT GetIs
3260: 6f 4d 65 74 61 64 61 74 61 49 64 28 20 27 63 64  oMetadataId( 'cd
3270: 37 36 63 39 61 32 2d 38 31 33 38 2d 34 65 37 65  76c9a2-8138-4e7e
3280: 2d 61 64 36 62 2d 32 65 31 30 35 63 33 37 65 36  -ad6b-2e105c37e6
3290: 35 63 27 20 29 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a 32  5c' );..-----..2
32a0: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54  ..</verbatim>..T
32b0: 68 65 20 3c 62 3e 47 65 74 49 73 6f 4d 65 74 61  he <b>GetIsoMeta
32c0: 64 61 74 61 49 64 28 29 3c 2f 62 3e 20 53 51 4c  dataId()</b> SQL
32d0: 20 66 75 6e 63 74 69 6f 6e 20 77 69 6c 6c 20 72   function will r
32e0: 65 74 75 72 6e 20 74 68 65 20 69 6e 74 65 72 6e  eturn the intern
32f0: 61 6c 20 3c 62 3e 69 64 3c 2f 62 3e 20 76 61 6c  al <b>id</b> val
3300: 75 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67  ue corresponding
3310: 20 74 6f 20 73 6f 6d 65 20 3c 62 3e 66 69 6c 65   to some <b>file
3320: 49 64 3c 2f 62 3e 3b 20 69 66 20 6e 6f 20 63 6f  Id</b>; if no co
3330: 72 72 65 73 70 6f 6e 64 69 6e 67 20 4d 65 74 61  rresponding Meta
3340: 64 61 74 61 20 64 6f 63 75 6d 65 6e 74 20 65 78  data document ex
3350: 69 73 74 73 2c 20 74 68 65 6e 20 3c 62 3e 5a 45  ists, then <b>ZE
3360: 52 4f 3c 2f 62 3e 20 77 69 6c 6c 20 62 65 20 72  RO</b> will be r
3370: 65 74 75 72 6e 65 64 2e 0d 0a 3c 76 65 72 62 61  eturned...<verba
3380: 74 69 6d 3e 0d 0a 55 50 44 41 54 45 20 49 53 4f  tim>..UPDATE ISO
3390: 5f 6d 65 74 61 64 61 74 61 0d 0a 53 45 54 20 6d  _metadata..SET m
33a0: 65 74 61 64 61 74 61 20 3d 20 58 42 5f 53 65 74  etadata = XB_Set
33b0: 50 61 72 65 6e 74 49 64 20 28 20 6d 65 74 61 64  ParentId ( metad
33c0: 61 74 61 20 2c 20 27 6e 65 77 2d 70 61 72 65 6e  ata , 'new-paren
33d0: 74 2d 69 64 27 20 29 0d 0a 57 48 45 52 45 20 69  t-id' )..WHERE i
33e0: 64 20 3d 20 32 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a 31  d = 2;..-----..1
33f0: 0d 0a 0d 0a 55 50 44 41 54 45 20 49 53 4f 5f 6d  ....UPDATE ISO_m
3400: 65 74 61 64 61 74 61 0d 0a 53 45 54 20 6d 65 74  etadata..SET met
3410: 61 64 61 74 61 20 3d 20 58 42 5f 53 65 74 50 61  adata = XB_SetPa
3420: 72 65 6e 74 49 64 20 28 20 6d 65 74 61 64 61 74  rentId ( metadat
3430: 61 20 2c 20 27 61 6e 6f 74 68 65 72 2d 70 61 72  a , 'another-par
3440: 65 6e 74 2d 69 64 27 20 29 0d 0a 57 48 45 52 45  ent-id' )..WHERE
3450: 20 69 64 20 3d 20 47 65 74 49 73 6f 4d 65 74 61   id = GetIsoMeta
3460: 64 61 74 61 49 64 28 20 27 63 64 37 36 63 39 61  dataId( 'cd76c9a
3470: 32 2d 38 31 33 38 2d 34 65 37 65 2d 61 64 36 62  2-8138-4e7e-ad6b
3480: 2d 32 65 31 30 35 63 33 37 65 36 35 63 27 20 29  -2e105c37e65c' )
3490: 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a 31 0d 0a 3c 2f 76  ;..-----..1..</v
34a0: 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20 3c 62  erbatim>..The <b
34b0: 3e 58 42 5f 53 65 74 46 69 6c 65 49 64 28 29 3c  >XB_SetFileId()<
34c0: 2f 62 3e 20 61 6e 64 20 3c 62 3e 58 42 5f 53 65  /b> and <b>XB_Se
34d0: 74 50 61 72 65 6e 74 49 64 28 29 3c 2f 62 3e 20  tParentId()</b> 
34e0: 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73 20 61 72  SQL functions ar
34f0: 65 20 72 65 73 70 65 63 74 69 76 65 6c 79 20 69  e respectively i
3500: 6e 74 65 6e 64 65 64 20 74 6f 20 63 68 61 6e 67  ntended to chang
3510: 65 20 74 68 65 20 3c 62 3e 26 6c 74 3b 66 69 6c  e the <b>&lt;fil
3520: 65 49 64 65 6e 74 69 66 69 65 72 26 67 74 3b 3c  eIdentifier&gt;<
3530: 2f 62 3e 20 6f 72 20 3c 62 3e 26 6c 74 3b 70 61  /b> or <b>&lt;pa
3540: 72 65 6e 74 49 64 65 6e 74 69 66 69 65 72 26 67  rentIdentifier&g
3550: 74 3b 3c 2f 62 3e 20 74 61 67 20 76 61 6c 75 65  t;</b> tag value
3560: 73 20 69 6e 74 65 72 6e 61 6c 6c 79 20 64 65 63  s internally dec
3570: 6c 61 72 65 64 20 77 69 74 68 69 6e 20 74 68 65  lared within the
3580: 20 58 4d 4c 20 64 6f 63 75 6d 65 6e 74 20 69 74   XML document it
3590: 73 65 6c 66 3b 20 74 68 65 20 73 75 70 70 6f 72  self; the suppor
35a0: 74 69 6e 67 20 3c 62 3e 54 72 69 67 67 65 72 73  ting <b>Triggers
35b0: 3c 2f 62 3e 20 77 69 6c 6c 20 74 68 65 6e 20 74  </b> will then t
35c0: 61 6b 65 20 63 61 72 65 20 74 6f 20 69 6d 6d 65  ake care to imme
35d0: 64 69 61 74 65 6c 79 20 6d 61 6b 65 20 76 69 73  diately make vis
35e0: 69 62 6c 65 20 74 68 69 73 20 63 68 61 6e 67 65  ible this change
35f0: 20 69 6e 20 74 68 65 20 63 6f 72 72 65 73 70 6f   in the correspo
3600: 6e 64 69 6e 67 20 74 61 62 6c 65 2f 63 6f 6c 75  nding table/colu
3610: 6d 6e 20 76 61 6c 75 65 73 2e 3c 62 72 3e 0d 0a  mn values.<br>..
3620: 3c 75 3e 50 6c 65 61 73 65 20 6e 6f 74 65 3c 2f  <u>Please note</
3630: 75 3e 3a 20 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e  u>: ..<ul>..<li>
3640: 74 68 65 20 6e 65 77 20 58 6d 6c 42 4c 4f 42 20  the new XmlBLOB 
3650: 6f 62 6a 65 63 74 20 28 74 68 65 20 6f 6e 65 20  object (the one 
3660: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 6d  containing the m
3670: 6f 64 69 66 69 65 64 20 69 64 65 6e 74 69 66 69  odified identifi
3680: 65 72 29 20 72 65 74 75 72 6e 65 64 20 62 79 20  er) returned by 
3690: 74 68 65 73 65 20 66 75 6e 63 74 69 6f 6e 73 20  these functions 
36a0: 77 69 6c 6c 20 73 75 70 70 6f 72 74 20 3c 62 3e  will support <b>
36b0: 63 6f 6d 70 72 65 73 73 69 6f 6e 3c 2f 62 3e 20  compression</b> 
36c0: 61 6e 64 20 3c 62 3e 73 63 68 65 6d 61 20 76 61  and <b>schema va
36d0: 6c 69 64 61 74 69 6f 6e 3c 2f 62 3e 20 65 78 61  lidation</b> exa
36e0: 63 74 6c 79 20 61 73 20 64 65 66 69 6e 65 64 20  ctly as defined 
36f0: 62 79 20 74 68 65 20 69 6e 70 75 74 20 58 6d 6c  by the input Xml
3700: 42 4c 4f 42 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  BLOB.</li>..<li>
3710: 74 68 65 73 65 20 66 75 6e 63 74 69 6f 6e 73 20  these functions 
3720: 73 69 6d 70 6c 79 20 61 6c 6c 6f 77 20 74 6f 20  simply allow to 
3730: 3c 75 3e 63 68 61 6e 67 65 2f 6d 6f 64 69 66 79  <u>change/modify
3740: 3c 2f 75 3e 20 61 6e 20 61 6c 72 65 61 64 79 20  </u> an already 
3750: 64 65 66 69 6e 65 64 20 58 4d 4c 20 74 61 67 20  defined XML tag 
3760: 76 61 6c 75 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75  value.</li>..</u
3770: 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a  l>..<verbatim>..
3780: 55 50 44 41 54 45 20 49 53 4f 5f 6d 65 74 61 64  UPDATE ISO_metad
3790: 61 74 61 0d 0a 53 45 54 20 6d 65 74 61 64 61 74  ata..SET metadat
37a0: 61 20 3d 20 58 42 5f 41 64 64 50 61 72 65 6e 74  a = XB_AddParent
37b0: 49 64 20 28 20 6d 65 74 61 64 61 74 61 20 2c 20  Id ( metadata , 
37c0: 43 72 65 61 74 65 55 55 49 44 28 29 20 2c 20 0d  CreateUUID() , .
37d0: 0a 20 20 20 20 27 67 6d 64 27 20 2c 20 27 68 74  .    'gmd' , 'ht
37e0: 74 70 3a 2f 2f 77 77 77 2e 69 73 6f 74 63 32 31  tp://www.isotc21
37f0: 31 2e 6f 72 67 2f 32 30 30 35 2f 67 6d 64 27 20  1.org/2005/gmd' 
3800: 2c 20 0d 0a 20 20 20 20 27 67 63 6f 27 20 2c 20  , ..    'gco' , 
3810: 27 68 74 74 70 3a 2f 2f 77 77 77 2e 69 73 6f 74  'http://www.isot
3820: 63 32 31 31 2e 6f 72 67 2f 32 30 30 35 2f 67 63  c211.org/2005/gc
3830: 6f 27 20 29 0d 0a 57 48 45 52 45 20 69 64 20 3d  o' )..WHERE id =
3840: 20 31 3b 0d 0a 2d 2d 2d 2d 2d 0d 0a 31 0d 0a 3c   1;..-----..1..<
3850: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 65 20  /verbatim>..The 
3860: 3c 62 3e 58 42 5f 41 64 64 46 69 6c 65 49 64 28  <b>XB_AddFileId(
3870: 29 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 58 42 5f  )</b> and <b>XB_
3880: 41 64 64 50 61 72 65 6e 74 49 64 28 29 3c 2f 62  AddParentId()</b
3890: 3e 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73 20  > SQL functions 
38a0: 61 72 65 20 72 65 73 70 65 63 74 69 76 65 6c 79  are respectively
38b0: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 69 6e 73   intended to ins
38c0: 65 72 74 20 61 20 3c 62 3e 26 6c 74 3b 66 69 6c  ert a <b>&lt;fil
38d0: 65 49 64 65 6e 74 69 66 69 65 72 26 67 74 3b 3c  eIdentifier&gt;<
38e0: 2f 62 3e 20 3c 62 3e 26 6c 74 3b 70 61 72 65 6e  /b> <b>&lt;paren
38f0: 74 49 64 65 6e 74 69 66 69 65 72 26 67 74 3b 3c  tIdentifier&gt;<
3900: 2f 62 3e 20 74 61 67 20 76 61 6c 75 65 73 20 69  /b> tag values i
3910: 6e 74 65 72 6e 61 6c 6c 79 20 64 65 63 6c 61 72  nternally declar
3920: 65 64 20 77 69 74 68 69 6e 20 74 68 65 20 58 4d  ed within the XM
3930: 4c 20 64 6f 63 75 6d 65 6e 74 20 69 74 73 65 6c  L document itsel
3940: 66 3b 20 74 68 65 20 73 75 70 70 6f 72 74 69 6e  f; the supportin
3950: 67 20 3c 62 3e 54 72 69 67 67 65 72 73 3c 2f 62  g <b>Triggers</b
3960: 3e 20 77 69 6c 6c 20 74 68 65 6e 20 74 61 6b 65  > will then take
3970: 20 63 61 72 65 20 74 6f 20 69 6d 6d 65 64 69 61   care to immedia
3980: 74 65 6c 79 20 6d 61 6b 65 20 76 69 73 69 62 6c  tely make visibl
3990: 65 20 74 68 69 73 20 63 68 61 6e 67 65 20 69 6e  e this change in
39a0: 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69   the correspondi
39b0: 6e 67 20 74 61 62 6c 65 2f 63 6f 6c 75 6d 6e 20  ng table/column 
39c0: 76 61 6c 75 65 73 2e 3c 62 72 3e 0d 0a 3c 75 3e  values.<br>..<u>
39d0: 50 6c 65 61 73 65 20 6e 6f 74 65 3c 2f 75 3e 3a  Please note</u>:
39e0: 20 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65   ..<ul>..<li>the
39f0: 20 6e 65 77 20 58 6d 6c 42 4c 4f 42 20 6f 62 6a   new XmlBLOB obj
3a00: 65 63 74 20 28 74 68 65 20 6f 6e 65 20 63 6f 6e  ect (the one con
3a10: 74 61 69 6e 69 6e 67 20 74 68 65 20 6d 6f 64 69  taining the modi
3a20: 66 69 65 64 20 69 64 65 6e 74 69 66 69 65 72 29  fied identifier)
3a30: 20 72 65 74 75 72 6e 65 64 20 62 79 20 74 68 65   returned by the
3a40: 73 65 20 66 75 6e 63 74 69 6f 6e 73 20 77 69 6c  se functions wil
3a50: 6c 20 73 75 70 70 6f 72 74 20 3c 62 3e 63 6f 6d  l support <b>com
3a60: 70 72 65 73 73 69 6f 6e 3c 2f 62 3e 20 61 6e 64  pression</b> and
3a70: 20 3c 62 3e 73 63 68 65 6d 61 20 76 61 6c 69 64   <b>schema valid
3a80: 61 74 69 6f 6e 3c 2f 62 3e 20 65 78 61 63 74 6c  ation</b> exactl
3a90: 79 20 61 73 20 64 65 66 69 6e 65 64 20 62 79 20  y as defined by 
3aa0: 74 68 65 20 69 6e 70 75 74 20 58 6d 6c 42 4c 4f  the input XmlBLO
3ab0: 42 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65  B.</li>..<li>the
3ac0: 73 65 20 66 75 6e 63 74 69 6f 6e 73 20 73 69 6d  se functions sim
3ad0: 70 6c 79 20 61 6c 6c 6f 77 20 74 6f 20 3c 75 3e  ply allow to <u>
3ae0: 69 6e 73 65 72 74 3c 2f 75 3e 20 61 20 6e 65 77  insert</u> a new
3af0: 20 28 6e 6f 74 20 61 6c 72 65 61 64 79 20 64 65   (not already de
3b00: 66 69 6e 65 64 29 20 58 4d 4c 20 74 61 67 20 76  fined) XML tag v
3b10: 61 6c 75 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  alue.</li>..<li>
3b20: 61 73 20 79 6f 75 20 63 61 6e 20 65 61 73 69 6c  as you can easil
3b30: 79 20 6e 6f 74 69 63 65 2c 20 74 68 65 20 3c 62  y notice, the <b
3b40: 3e 58 42 5f 41 64 64 3f 3f 49 64 28 29 3c 2f 62  >XB_Add??Id()</b
3b50: 3e 20 66 75 6e 63 74 69 6f 6e 73 20 72 65 71 75  > functions requ
3b60: 69 72 65 20 6d 6f 72 65 20 61 72 67 75 6d 65 6e  ire more argumen
3b70: 74 73 20 74 68 61 6e 20 74 68 65 20 63 6f 72 72  ts than the corr
3b80: 65 73 70 6f 6e 64 69 6e 67 20 3c 62 3e 58 42 5f  esponding <b>XB_
3b90: 53 65 74 3f 3f 49 64 28 29 3c 2f 62 3e 20 66 75  Set??Id()</b> fu
3ba0: 6e 63 74 69 6f 6e 73 3a 0d 0a 3c 75 6c 3e 0d 0a  nctions:..<ul>..
3bb0: 3c 6c 69 3e 74 68 69 72 64 20 61 6e 64 20 66 6f  <li>third and fo
3bc0: 75 72 74 68 20 61 72 67 75 6d 65 6e 74 73 20 61  urth arguments a
3bd0: 72 65 20 65 78 70 65 63 74 65 64 20 74 6f 20 73  re expected to s
3be0: 70 65 63 69 66 79 20 74 68 65 20 3c 75 3e 6e 61  pecify the <u>na
3bf0: 6d 65 73 70 61 63 65 3c 2f 75 3e 20 74 6f 20 62  mespace</u> to b
3c00: 65 20 61 64 6f 70 74 65 64 20 66 6f 72 20 74 68  e adopted for th
3c10: 65 20 3c 62 3e 26 6c 74 3b 66 69 6c 65 49 64 65  e <b>&lt;fileIde
3c20: 6e 74 69 66 69 65 72 26 67 74 3b 3c 2f 62 3e 20  ntifier&gt;</b> 
3c30: 6f 72 20 3c 62 3e 26 6c 74 3b 70 61 72 65 6e 74  or <b>&lt;parent
3c40: 49 64 65 6e 74 69 66 69 65 72 26 67 74 3b 3c 2f  Identifier&gt;</
3c50: 62 3e 20 58 4d 4c 20 74 61 67 73 2e 3c 2f 6c 69  b> XML tags.</li
3c60: 3e 0d 0a 3c 6c 69 3e 66 69 66 74 68 20 61 6e 64  >..<li>fifth and
3c70: 20 73 69 78 74 68 20 61 72 67 75 6d 65 6e 74 73   sixth arguments
3c80: 20 70 6c 61 79 20 65 78 61 63 74 6c 79 20 74 68   play exactly th
3c90: 65 20 73 61 6d 65 20 69 64 65 6e 74 69 63 61 6c  e same identical
3ca0: 20 72 6f 6c 65 2c 20 74 68 69 73 20 74 69 6d 65   role, this time
3cb0: 20 64 65 66 69 6e 69 6e 67 20 74 68 65 20 3c 75   defining the <u
3cc0: 3e 6e 61 6d 65 73 70 61 63 65 3c 2f 75 3e 20 74  >namespace</u> t
3cd0: 6f 20 62 65 20 61 64 6f 70 74 65 64 20 66 6f 72  o be adopted for
3ce0: 20 74 68 65 20 3c 62 3e 26 6c 74 3b 43 68 61 72   the <b>&lt;Char
3cf0: 61 63 74 65 72 53 74 72 69 6e 67 26 67 74 3b 3c  acterString&gt;<
3d00: 2f 62 3e 20 58 4d 4c 20 74 61 67 2e 3c 2f 6c 69  /b> XML tag.</li
3d10: 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 74 68 65 73 65  >..<li>all these
3d20: 20 61 72 67 75 6d 65 6e 74 73 20 63 6f 75 6c 64   arguments could
3d30: 20 62 65 20 73 65 74 20 74 6f 20 3c 62 3e 4e 55   be set to <b>NU
3d40: 4c 4c 3c 2f 62 3e 20 77 68 65 6e 20 61 70 70 72  LL</b> when appr
3d50: 6f 70 72 69 61 74 65 2e 3c 2f 6c 69 3e 0d 0a 3c  opriate.</li>..<
3d60: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e  /ul></li>..</ul>
3d70: 0d 0a 3c 75 3e 52 65 6d 65 6d 62 65 72 3c 2f 75  ..<u>Remember</u
3d80: 3e 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 61 6e  >:..<ul>..<li>an
3d90: 20 3c 75 3e 58 4d 4c 20 6e 61 6d 65 73 70 61 63   <u>XML namespac
3da0: 65 3c 2f 75 3e 20 69 73 20 61 6c 77 61 79 73 20  e</u> is always 
3db0: 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 61 6e  identified by an
3dc0: 20 3c 75 3e 55 52 4c 3c 2f 75 3e 20 61 6e 64 20   <u>URL</u> and 
3dd0: 6d 61 79 20 65 76 65 6e 74 75 61 6c 6c 79 20 62  may eventually b
3de0: 65 20 61 73 73 6f 63 69 61 74 65 64 20 74 6f 20  e associated to 
3df0: 61 20 3c 75 3e 70 72 65 66 69 78 3c 2f 75 3e 2e  a <u>prefix</u>.
3e00: 3c 62 72 3e 0d 0a 53 6f 2c 20 61 73 73 75 6d 69  <br>..So, assumi
3e10: 6e 67 20 74 68 61 74 20 61 20 3c 62 3e 67 63 6f  ng that a <b>gco
3e20: 3c 2f 62 3e 20 6e 61 6d 65 73 70 61 63 65 20 69  </b> namespace i
3e30: 73 20 61 6c 72 65 61 64 79 20 64 65 66 69 6e 65  s already define
3e40: 64 20 69 6e 20 74 68 65 20 74 61 72 67 65 74 20  d in the target 
3e50: 58 4d 4c 20 64 6f 63 75 6d 65 6e 74 20 28 2e 2e  XML document (..
3e60: 2e 20 3c 62 3e 78 6d 6c 6e 73 3a 67 63 6f 3d 22  . <b>xmlns:gco="
3e70: 68 74 74 70 3a 2f 2f 77 77 77 2e 69 73 6f 74 63  http://www.isotc
3e80: 32 31 31 2e 6f 72 67 2f 32 30 30 35 2f 67 63 6f  211.org/2005/gco
3e90: 22 3c 2f 62 3e 20 2e 2e 2e 29 2c 20 79 6f 75 20  "</b> ...), you 
3ea0: 63 61 6e 20 73 69 6d 70 6c 79 20 70 61 73 73 20  can simply pass 
3eb0: 3c 62 3e 27 67 63 6f 27 2c 20 4e 55 4c 4c 3c 2f  <b>'gco', NULL</
3ec0: 62 3e 20 28 6f 72 20 3c 62 3e 4e 55 4c 4c 2c 20  b> (or <b>NULL, 
3ed0: 27 68 74 74 70 3a 2f 2f 77 77 77 2e 69 73 6f 74  'http://www.isot
3ee0: 63 32 31 31 2e 6f 72 67 2f 32 30 30 35 2f 67 63  c211.org/2005/gc
3ef0: 6f 27 3c 2f 62 3e 29 20 61 73 20 74 68 65 20 66  o'</b>) as the f
3f00: 69 66 74 68 20 61 6e 64 20 73 69 78 74 68 20 61  ifth and sixth a
3f10: 72 67 75 6d 65 6e 74 73 2c 20 61 6e 64 20 69 6e  rguments, and in
3f20: 20 62 6f 74 68 20 63 61 73 65 73 20 61 20 3c 62   both cases a <b
3f30: 3e 26 6c 74 3b 67 63 6f 3a 43 68 61 72 61 63 74  >&lt;gco:Charact
3f40: 65 72 53 74 72 69 6e 67 26 67 74 3b 3c 2f 62 3e  erString&gt;</b>
3f50: 20 58 4d 4c 20 74 61 67 20 77 69 6c 6c 20 62 65   XML tag will be
3f60: 20 63 72 65 61 74 65 64 2c 20 62 65 63 61 75 73   created, becaus
3f70: 65 20 79 6f 75 20 63 61 6e 20 72 65 66 65 72 65  e you can refere
3f80: 6e 63 65 20 61 6e 20 61 6c 72 65 61 64 79 20 64  nce an already d
3f90: 65 66 69 6e 65 64 20 6e 61 6d 65 73 70 61 63 65  efined namespace
3fa0: 20 62 79 20 3c 75 3e 70 72 65 66 69 78 3c 2f 75   by <u>prefix</u
3fb0: 3e 20 6f 72 20 62 79 20 3c 75 3e 55 52 4c 3c 2f  > or by <u>URL</
3fc0: 75 3e 20 69 6e 64 69 66 66 65 72 65 6e 74 6c 79  u> indifferently
3fd0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 66 20 61  .</li>..<li>if a
3fe0: 20 73 6f 20 63 61 6c 6c 65 64 20 3c 75 3e 64 65   so called <u>de
3ff0: 66 61 75 6c 74 20 6e 61 6d 65 73 70 61 63 65 3c  fault namespace<
4000: 2f 75 3e 20 69 73 20 61 6c 72 65 61 64 79 20 64  /u> is already d
4010: 65 66 69 6e 65 64 20 69 6e 20 74 68 65 20 74 61  efined in the ta
4020: 72 67 65 74 20 58 4d 4c 20 64 6f 63 75 6d 65 6e  rget XML documen
4030: 74 20 28 2e 2e 2e 20 3c 62 3e 78 6d 6c 6e 73 3d  t (... <b>xmlns=
4040: 22 68 74 74 70 3a 2f 2f 77 77 77 2e 69 73 6f 74  "http://www.isot
4050: 63 32 31 31 2e 6f 72 67 2f 32 30 30 35 2f 67 6d  c211.org/2005/gm
4060: 64 22 3c 2f 62 3e 20 2e 2e 2e 29 2c 20 79 6f 75  d"</b> ...), you
4070: 20 63 61 6e 20 73 69 6d 70 6c 79 20 70 61 73 73   can simply pass
4080: 20 3c 62 3e 27 67 6d 64 27 2c 20 4e 55 4c 4c 3c   <b>'gmd', NULL<
4090: 2f 62 3e 20 28 6f 72 20 3c 62 3e 4e 55 4c 4c 2c  /b> (or <b>NULL,
40a0: 20 27 68 74 74 70 3a 2f 2f 77 77 77 2e 69 73 6f   'http://www.iso
40b0: 74 63 32 31 31 2e 6f 72 67 2f 32 30 30 35 2f 67  tc211.org/2005/g
40c0: 6d 64 27 3c 2f 62 3e 2c 20 6f 72 20 65 6c 73 65  md'</b>, or else
40d0: 20 3c 62 3e 4e 55 4c 4c 2c 20 4e 55 4c 4c 3c 2f   <b>NULL, NULL</
40e0: 62 3e 29 20 61 73 20 74 68 65 20 66 6f 75 72 74  b>) as the fourt
40f0: 68 20 61 6e 64 20 66 69 66 74 68 20 61 72 67 75  h and fifth argu
4100: 6d 65 6e 74 73 2c 20 61 6e 64 20 69 6e 20 61 6e  ments, and in an
4110: 79 20 63 61 73 65 20 61 20 3c 62 3e 26 6c 74 3b  y case a <b>&lt;
4120: 66 69 6c 65 49 64 65 6e 74 69 66 69 65 72 26 67  fileIdentifier&g
4130: 74 3b 3c 2f 62 3e 20 58 4d 4c 20 74 61 67 20 28  t;</b> XML tag (
4140: 6e 6f 20 70 72 65 66 69 78 29 20 77 69 6c 6c 20  no prefix) will 
4150: 62 65 20 63 72 65 61 74 65 64 2e 3c 2f 6c 69 3e  be created.</li>
4160: 0d 0a 3c 6c 69 3e 61 6e 79 77 61 79 3a 20 61 6c  ..<li>anyway: al
4170: 77 61 79 73 20 70 61 73 73 69 6e 67 20 61 20 66  ways passing a f
4180: 75 6c 6c 20 71 75 61 6c 69 66 69 65 64 20 6e 61  ull qualified na
4190: 6d 65 73 70 61 63 65 20 28 65 78 70 6c 69 63 69  mespace (explici
41a0: 74 6c 79 20 73 70 65 63 69 66 79 69 6e 67 20 62  tly specifying b
41b0: 6f 74 68 20 3c 75 3e 70 72 65 66 69 78 3c 2f 75  oth <u>prefix</u
41c0: 3e 20 61 6e 64 20 3c 75 3e 55 52 4c 3c 2f 75 3e  > and <u>URL</u>
41d0: 29 20 69 73 20 73 75 72 65 6c 79 20 62 65 74 74  ) is surely bett
41e0: 65 72 20 61 6e 64 20 61 76 6f 69 64 20 6d 61 6e  er and avoid man
41f0: 79 20 70 6f 73 73 69 62 6c 65 20 70 69 74 66 61  y possible pitfa
4200: 6c 6c 73 3b 20 69 6e 20 74 68 69 73 20 63 61 73  lls; in this cas
4210: 65 20 61 6e 20 61 70 70 72 6f 70 72 69 61 74 65  e an appropriate
4220: 20 3c 62 3e 78 6d 6c 6e 73 3c 2f 62 3e 20 64 65   <b>xmlns</b> de
4230: 63 6c 61 72 61 74 69 6f 6e 20 77 69 6c 6c 20 62  claration will b
4240: 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20  e automatically 
4250: 69 6e 73 65 72 74 65 64 20 69 6e 74 6f 20 74 68  inserted into th
4260: 65 20 58 4d 4c 20 64 6f 63 75 6d 65 6e 74 2e 3c  e XML document.<
4270: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 68 72  /li>..</ul>..<hr
4280: 3e 3c 62 72 3e 0d 0a 62 61 63 6b 20 74 6f 20 58  ><br>..back to X
4290: 6d 6c 42 6c 6f 62 20 3c 61 20 68 72 65 66 3d 22  mlBlob <a href="
42a0: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61  https://www.gaia
42b0: 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c  -gis.it/fossil/l
42c0: 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b  ibspatialite/wik
42d0: 69 3f 6e 61 6d 65 3d 58 6d 6c 42 6c 6f 62 2b 61  i?name=XmlBlob+a
42e0: 6e 64 2b 56 69 72 74 75 61 6c 58 50 61 74 68 22  nd+VirtualXPath"
42f0: 3e 6d 61 69 6e 20 70 61 67 65 3c 2f 61 3e 0a 5a  >main page</a>.Z
4300: 20 65 30 34 62 65 65 61 61 30 33 38 61 66 38 61   e04beeaa038af8a
4310: 38 34 66 61 33 30 35 37 33 64 36 30 64 62 35 61  84fa30573d60db5a
4320: 64 0a                                            d.