fixed mkStereotype

git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@2954 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Jürgen Doser 2005-08-19 14:40:25 +00:00
parent fad686ade3
commit ab657b2ecf
3 changed files with 11 additions and 6 deletions

View File

@ -520,7 +520,9 @@ fun filterStereotypes trees = filterByName "UML:Stereotype" trees
fun mkStereotype atts trees =
{ xmiid = getXmiId atts,
name = getName atts
name = getName atts,
baseClass = NONE,
stereotypeConstraint = NONE
}
handle IllFormed msg => raise IllFormed ("in mkStereotype: "^msg)
@ -560,11 +562,10 @@ fun findXmiContent tree = if XmlTreeData.getElem tree = "XMI.content"
(XmlTreeData.getTrees tree))
fun parseXMI filename =
let val trees = findXmiContent (ParseXmlTree.parseXmlTree filename)
let val trees = findXmiContent (ParseXmlTree.readFile filename)
in
tree2xmicontent (hd trees)
end
handle IllFormed msg => error msg
end

View File

@ -204,7 +204,7 @@ type Stereotype = {xmiid: string,
(* extendedElement: string list *)
(* definedTag: string list *)
stereotypeConstraint: Constraint option,
baseClass: string}
baseClass: string option}
(* from UML 1.5 Extension Mechanisms:-----------------------------------------
* A tag definition specifies the tagged values that can be attached to a kind

View File

@ -98,12 +98,15 @@ structure ParseXmlTree = (* :
end = *)
struct
open XmlTreeData
exception FileNotFound of string
structure Parser = Parse (structure Dtd = Dtd
structure Hooks = XmlTreeHooks
structure ParserOptions = ParserOptions ()
structure Resolve = ResolveNull)
fun parseXmlTree filename =
fun readFile filename =
let val currentDir = OS.FileSys.getDir()
val _ = OS.FileSys.fileSize filename (* dummy check to see if the file exists...*)
val dtd = Dtd.initDtdTables()
@ -117,6 +120,7 @@ fun parseXmlTree filename =
in Parser.parseDocument
(SOME (Uri.String2Uri filename))
(SOME dtd) (dtd,nil,nil)
handle SysErr => raise FileNotFound filename
end
end
@ -150,7 +154,7 @@ fun writeXmlTree' indent stream tree =
writeEndTag stream elemName
end
fun writeXmlTree filename tree =
fun writeFile filename tree =
let val stream = TextIO.openOut filename
in
writeXmlTree' 0 stream tree;