Simple token replacement system for content files.
Inheritance: IPackageFileTransformer
Example #1
0
        public static Manifest ReadFrom(Stream stream, IPropertyProvider propertyProvider, bool validateSchema)
        {
            XDocument document        = !ReferenceEquals(propertyProvider, NullPropertyProvider.Instance) ? XDocument.Parse(Preprocessor.Process(stream, propertyProvider, true)) : XmlUtility.LoadSafe(stream, true);
            string    schemaNamespace = GetSchemaNamespace(document);

            foreach (XElement local1 in document.Descendants())
            {
                local1.Name = XName.Get(local1.Name.LocalName, schemaNamespace);
            }
            CheckSchemaVersion(document);
            if (validateSchema)
            {
                ValidateManifestSchema(document, schemaNamespace);
            }
            Manifest manifest = ManifestReader.ReadManifest(document);

            Validate(manifest);
            return(manifest);
        }
        private static XElement GetXml(IPackageFile file, IProjectSystem projectSystem)
        {
            var content = Preprocessor.Process(file, projectSystem);

            return(XElement.Parse(content, LoadOptions.PreserveWhitespace));
        }
Example #3
0
        private static XElement GetXml(IPackageFile file, IProjectSystem projectSystem)
        {
            var content = Preprocessor.Process(file, projectSystem);

            return(XElement.Parse(content));
        }