sqlmap_xml.go 497 B

123456789101112131415161718192021222324252627282930
  1. package xorm
  2. type XmlSqlMap struct {
  3. sqlMapRootDir string
  4. extension string
  5. }
  6. type XmlSql struct {
  7. Sql []Sql `xml:"sql"`
  8. }
  9. type Sql struct {
  10. Value string `xml:",chardata"`
  11. Id string `xml:"id,attr"`
  12. }
  13. func Xml(directory, extension string) *XmlSqlMap {
  14. return &XmlSqlMap{
  15. sqlMapRootDir: directory,
  16. extension: extension,
  17. }
  18. }
  19. func (sqlMap *XmlSqlMap) RootDir() string {
  20. return sqlMap.sqlMapRootDir
  21. }
  22. func (sqlMap *XmlSqlMap) Extension() string {
  23. return sqlMap.extension
  24. }