github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/staticcheck/fakexml/xml.go (about) 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 5 package fakexml 6 7 // References: 8 // Annotated XML spec: https://www.xml.com/axml/testaxml.htm 9 // XML name spaces: https://www.w3.org/TR/REC-xml-names/ 10 11 // TODO(rsc): 12 // Test error handling. 13 14 // A Name represents an XML name (Local) annotated 15 // with a name space identifier (Space). 16 // In tokens returned by Decoder.Token, the Space identifier 17 // is given as a canonical URL, not the short prefix used 18 // in the document being parsed. 19 type Name struct { 20 Space, Local string 21 } 22 23 // An Attr represents an attribute in an XML element (Name=Value). 24 type Attr struct { 25 Name Name 26 Value string 27 } 28 29 // A StartElement represents an XML start element. 30 type StartElement struct { 31 Name Name 32 Attr []Attr 33 }