I have this data set which is structured just like XML data except it doesn't use <> or </> to separate data but instead uses a (), tab, and new line. But the data works the same way, there are schema definitions and child/parent nodes.
Is there a way in C# to read/write to this data using something similar to XPathSelectElements() ?
Here is a sample of the Data I need to parse through:
WARNING: Do Not Modify This File!
Check 24.1.6 Data File
CONTROL 1 (
code = CEZ_90_1_2016
compliance mode = UA
version = 24.1.6 )
LOCATION 1 (
state = Texas
city = USA )
BUILDING 1 (
project type = NEW_CONSTRUCTION
bldg use type = WHOLE_BLDG
feet bldg height = 0.000
number of stories = 1
is nonresidential conditioning = TRUE
is residential conditioning = FALSE
is semiheated conditioning = FALSE
conditioning = HEATING_AND_COOLING)
ENVELOPE 1 (
use orient details = TRUE
use vlt details = TRUE
use cool roof performance details = FALSE )
AG WALL 1 (
wall type = MASONRY_AG_WALL
next to uncond space = FALSE
concrete thickness = 12.00
concrete density = 115.00
furring type = NO_FURRING
cmu type = CMU_PARTIAL_GROUT_CELLS_EMPTY
list position = 1
description = <|Concrete Block:12", Partially Grouted, Cells Empty|>
assembly type = <|Exterior Wall 1|>
parent number = 0
bldg use key = 1884629903
continuous rvalue = 10.00
daylight credit = 0.000
orientation = WEST
allowance type = ENV_ALLOWANCE_NONE
exemption type = ENV_EXEMPTION_NONE
valid allowance type = FALSE
valid exemption type = FALSE
construction type = NON_RESIDENTIAL
adjacent space type = ADJACENT_SPACE_EXTERIOR
gross area = 3377.000)
DOOR 4 (
door type = INSUL_METAL_DOOR
door open type = SWINGING_DOOR
list position = 3
description = <|Insulated Metal|>
assembly type = <|Door 1|>
parent number = 1
bldg use key = 1884629903
prop uvalue = 0.100000
daylight credit = 0.000
orientation = WEST
allowance type = ENV_ALLOWANCE_NONE
exemption type = ENV_EXEMPTION_NONE
valid allowance type = FALSE
valid exemption type = FALSE
construction type = NON_RESIDENTIAL
adjacent space type = ADJACENT_SPACE_EXTERIOR
gross area = 21.000)
AG WALL 2 (
wall type = METAL_FRAME_16_AG_WALL
next to uncond space = FALSE
list position = 4
description = <|Steel-Framed, 16" o.c.|>
assembly type = <|Exterior Wall 2|>
parent number = 0
bldg use key = 1884629903
cavity rvalue = 21.00
continuous rvalue = 0.00
daylight credit = 0.000
orientation = NORTH
allowance type = ENV_ALLOWANCE_NONE
exemption type = ENV_EXEMPTION_NONE
valid allowance type = FALSE
valid exemption type = FALSE
construction type = NON_RESIDENTIAL
adjacent space type = ADJACENT_SPACE_EXTERIOR
gross area = 42.000)
And here is the schema layout. As you see it even says rootXmlClass, so this is an xml format, I am just very confused how it works with this tab, newline, and parenthesis format instead of your typical XML files. I also got the .xsd schema definition from the creator of this software but it did not provide me any help...
# Documentation available at https://cvs.pnl.gov/BecpApps/wiki/schemaGenerator
namespace http://energycode.pnl.gov/ns/ComCheckBuildingSchema
rootXmlClass BUILDING
#############################
# Building and Project Data #
#############################
class BUILDING
child CONTROL 1
child EFFICIENCY_PACKAGE efficiencyPackages
child LOCATION 1
child PROJECT 1
child ENVELOPE 1
child LIGHTING 1
child HVAC 1
child SWH_SYSTEM serviceWaterHeating
child REQUIREMENT_ANSWER requirements
class CONTROL
class PROJECT
class LOCATION
class WHOLE_BLDG_USE
child INTERIOR_SPACE 1 activity_category_number
class ACTIVITY_USE
child INTERIOR_SPACE 1 activity_category_number
class EXTERIOR_USE
child EXTERIOR_SPACE 1 linked_use_area_index
#################
# Lighting Data #
#################
container LIGHTING
child WHOLE_BLDG_USE
child ACTIVITY_USE
child EXTERIOR_USE
class INTERIOR_SPACE interiorLightingSpace
child FIXTURE * parent_number
# Removed "child FIXTURE * parent_number" from the EXTERIOR_SPACE class, which will break the schema generator
class EXTERIOR_SPACE exteriorLightingSpace
child EXTERIOR_FIXTURE fixtures parent_number
class FIXTURE
class EXTERIOR_FIXTURE fixture
#################
# Envelope Date #
#################
container ENVELOPE
child AG_WALL aboveGroundWalls
child BG_WALL belowGroundWalls
child ROOF
child FLOOR
child DOOR
child WINDOW
child SKYLIGHT
class AG_WALL
child WINDOW * parent_number
child DOOR * parent_number
class BG_WALL
child WINDOW * parent_number
child DOOR * parent_number
class FLOOR
class ROOF
child SKYLIGHT * parent_number
class SKYLIGHT
class WINDOW
class DOOR
###################
# Mechanical Data #
###################
container HVAC
child HVAC_SYSTEM
child HVAC_PLANT
child FAN_SYSTEM
class HVAC_SYSTEM
child REQUIREMENT_ANSWER requirements parent_number
class HVAC_PLANT
child REQUIREMENT_ANSWER requirements parent_number
class SWH_SYSTEM
child REQUIREMENT_ANSWER requirements parent_number
class FAN_SYSTEM
child FAN * parent_number
child PRESSURE_DROP_CREDIT * parent_number
class FAN
class PRESSURE_DROP_CREDIT
################
# Requirements #
################
class REQUIREMENT_ANSWER
################
# efficiency Packages #
################
class EFFICIENCY_PACKAGE
Thank you