xml.go 862 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2009 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package fakexml
  5. // References:
  6. // Annotated XML spec: https://www.xml.com/axml/testaxml.htm
  7. // XML name spaces: https://www.w3.org/TR/REC-xml-names/
  8. // TODO(rsc):
  9. // Test error handling.
  10. // A Name represents an XML name (Local) annotated
  11. // with a name space identifier (Space).
  12. // In tokens returned by Decoder.Token, the Space identifier
  13. // is given as a canonical URL, not the short prefix used
  14. // in the document being parsed.
  15. type Name struct {
  16. Space, Local string
  17. }
  18. // An Attr represents an attribute in an XML element (Name=Value).
  19. type Attr struct {
  20. Name Name
  21. Value string
  22. }
  23. // A StartElement represents an XML start element.
  24. type StartElement struct {
  25. Name Name
  26. Attr []Attr
  27. }