Knowledge (XXG)

QName

Source 📝

389:
In line two the prefix "x" is declared to be associated with the URI "http://example.com/ns/foo". This prefix can further on be used as abbreviation for this namespace. Subsequently, the tag "x:p" is a valid QName because it uses the "x" as namespace reference and "p" as local part. The tag "doc" is
78:
Since URI references can be long and may contain prohibited characters for element/attribute naming, QNames are used to create a mapping between the URI and a namespace prefix. The mapping enables the abbreviation of URIs, therefore it achieves a more convenient way to write XML documents (see
356:
Whereby the Prefix is used as placeholder for the namespace and the LocalPart as the local part of the qualified name. A local part can be an attribute name or an element name.
67: 47:
of an element, attribute, or identifier in that namespace. To make this association, the QName assigns the local name a
440: 63: 408: 28: 51:
that corresponds to its namespace. In all, the QName comprises the URI of the XML namespace, the
432: 507: 461: 40: 513: 495: 484: 16:
Fully qualified name of an element, attribute, or identifier in an XML document
460:
Bray, Tim; Hollander, Dave; Layman, Andrew, eds. (14 January 1999),
399: 318:(* any Unicode char, excluding surrogate blocks FFFE and FFFF. *) 433:"Using Qualified Names (QNames) as Identifiers in XML Content" 403: 36: 32: 390:
also a valid QName, but it consists only of a local part.
31:of an element, attribute, or identifier in an 8: 66:introduced the QName convention in the 1999 87:QNames are formally defined by the W3C as: 35:document. A QName concisely associates the 192:(* An XML Name, minus the ":" *) 426: 424: 420: 496:Namespaces in XML 1.0 (Second Edition) 485:Namespaces in XML 1.0 (Second Edition) 375:"https://example.com/ns/foo" 366:<?xml version="1.0"?> 7: 431:Walsh, Norman, ed. (17 March 2004). 14: 154:NCName is defined as follows: 1: 468:, World Wide Web Consortium 530: 441:World Wide Web Consortium 64:World Wide Web Consortium 363: 156: 89: 70:"Namespaces in XML". 409:Fully qualified name 29:fully qualified name 462:"Namespaces in XML" 273:NameChar 143:LocalPart 125:UnprefixedName 83:Formal definition 521: 498: 493: 487: 482: 476: 475: 474: 473: 457: 451: 450: 448: 447: 428: 385: 382: 379: 376: 373: 370: 367: 352: 349: 346: 343: 340: 337: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 289: 286: 283: 280: 277: 274: 271: 268: 265: 262: 259: 256: 253: 250: 247: 244: 241: 238: 235: 232: 229: 226: 223: 220: 217: 214: 211: 208: 205: 202: 199: 196: 193: 190: 187: 184: 181: 178: 175: 172: 169: 166: 163: 160: 150: 147: 144: 141: 138: 135: 132: 129: 126: 123: 120: 117: 114: 111: 108: 105: 102: 99: 96: 93: 79:example below). 529: 528: 524: 523: 522: 520: 519: 518: 504: 503: 502: 501: 494: 490: 483: 479: 471: 469: 459: 458: 454: 445: 443: 430: 429: 422: 417: 396: 387: 386: 383: 380: 377: 374: 371: 368: 365: 362: 354: 353: 350: 347: 344: 341: 338: 335: 332: 329: 326: 323: 320: 317: 314: 311: 308: 305: 302: 299: 296: 293: 290: 287: 284: 281: 278: 275: 272: 269: 266: 263: 260: 257: 254: 251: 248: 245: 242: 239: 236: 233: 230: 227: 224: 221: 218: 215: 212: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 176: 173: 170: 167: 164: 161: 158: 152: 151: 148: 145: 142: 139: 136: 133: 130: 127: 124: 121: 118: 115: 112: 109: 106: 103: 100: 97: 94: 91: 85: 76: 17: 12: 11: 5: 527: 525: 517: 516: 506: 505: 500: 499: 488: 477: 452: 419: 418: 416: 413: 412: 411: 406: 395: 392: 364: 361: 358: 279:NameStartChar 201:NameStartChar 157: 107:UnprefixedName 90: 84: 81: 75: 72: 25:qualified name 15: 13: 10: 9: 6: 4: 3: 2: 526: 515: 512: 511: 509: 497: 492: 489: 486: 481: 478: 467: 463: 456: 453: 442: 438: 434: 427: 425: 421: 414: 410: 407: 405: 401: 398: 397: 393: 391: 359: 357: 291:"." 285:"-" 231:"_" 222:":" 216:NameStartChar 155: 101:PrefixedName 88: 82: 80: 73: 71: 69: 68:specification 65: 60: 58: 54: 50: 46: 42: 41:XML namespace 38: 34: 30: 26: 22: 491: 480: 470:, retrieved 465: 455: 444:. Retrieved 436: 388: 384:</doc> 381:<x:p/> 355: 153: 110:PrefixedName 86: 77: 61: 56: 52: 48: 44: 24: 20: 18: 180:':' 119:':' 472:2018-06-12 446:2018-06-12 415:References 402:: Compact 57:local name 55:, and the 45:local name 131:LocalPart 122:LocalPart 43:with the 27:, is the 508:Category 394:See also 372:xmlns:x= 207:NameChar 369:<doc 360:Example 168:Name - 116:Prefix 74:Purpose 466:W3.org 437:W3.org 159:NCName 149:NCName 140:NCName 134:Prefix 53:prefix 49:prefix 39:of an 400:CURIE 92:QName 23:, or 21:QName 378:> 312:Char 303:xB7 195:Name 183:Char 174:Char 62:The 514:XML 404:URI 342:xD 333:xA 324:x9 315:::= 276:::= 219:::= 198:::= 146:::= 137:::= 128:::= 113:::= 37:URI 33:XML 510:: 464:, 439:. 435:. 423:^ 162::: 95::: 59:. 19:A 449:. 351:| 348:| 345:| 339:# 336:| 330:# 327:| 321:# 309:| 306:| 300:# 297:| 294:| 288:| 282:| 270:| 267:| 264:| 261:| 258:| 255:| 252:| 249:| 246:| 243:| 240:| 237:| 234:| 228:| 225:| 213:* 210:) 204:( 189:) 186:* 177:* 171:( 165:= 104:| 98:=

Index

fully qualified name
XML
URI
XML namespace
World Wide Web Consortium
specification
CURIE
URI
Fully qualified name


"Using Qualified Names (QNames) as Identifiers in XML Content"
World Wide Web Consortium
"Namespaces in XML"
Namespaces in XML 1.0 (Second Edition)
Namespaces in XML 1.0 (Second Edition)
Category
XML

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.